Type parameters are treated differently based on their names

Half jokingly, maybe we should do

macro UnionAll(var, expr)
    Expr(:where, esc(expr), esc(var))
end

T = gensym()
TypeVarT = TypeVar(T)
TypeT = Type{TypeVarT}
MyType = UnionAll(TypeVarT, @UnionAll T TypeT)

MyType === MyType{T} where T

instead? BTW, for these kind of questions I always need the help of https://github.com/JuliaLang/julia/blob/master/test/subtype.jl

1 Like