What is a unionall type?

the concrete vector type which can hold any complex number would be Array{Complex{Any},1}.

Semantic precision becomes necessary here. That Array can only hold instances of the Complex{Any} type. Whereas Array{Complex, 1} can hold instances of any subtype of Complex. Note that Complex is type equal to Complex{T} where T (meaning they are the same type). So it is the same expression as it is today, but the nesting semantics today are ambiguous, which can lead to erroneous type computations during inference and dispatch.

So, is there a convenient way of constructing and maintaining a binding to an abstract type

No, leaftypes are not permitted to have subtypes (which does answer your question, just in reverse).

ANY being the only way I know of, whereas ANY{T} where T might be a better model of an abstract box at the Julia language level.

I’m not sure what this is supposed to mean. There is a TypeVar in the system named ANY, which is type equal to Any, but which dispatch can detect as a user hint to avoid compiling a method specialization on that argument. A TypeVar cannot be parameterized by another TypeVar, so that specification isn’t particularly meaningful.

2 Likes