Vararg not always recognized as a type


#1

We have

julia> Vararg isa Type
true

Since the manual states that every type T is an instance of Type{T}, I find this unexpected:

julia> Vararg isa Type{Vararg}
ERROR: TypeError: in Type, in parameter, expected Type, got Type{Vararg}

julia> t = Vararg
Vararg

julia> t isa Type{t}
ERROR: TypeError: in Type, in parameter, expected Type, got Type{Vararg}

#2

Hah I was just puzzling over that a minute ago!


#3

Vararg is more of a “pseudo-type” that only makes sense as part of the structure of a tuple type. We should probably make Vararg isa Type false (similar to how TypeVars are not Types). In particular, it’s not valid to substitute Vararg as the value of a typevar, since then Tuple{T} where T is not necessarily a 1-element tuple, which would be very inconvenient.