Open topolarity opened 1 year ago
Something similar with T in an invariant position:
julia> supertype(Int64)
Signed
julia> (Ref{T} where Int64<:T<:Signed) == Union{Ref{Int64},Ref{Signed}}
false
Or combining both of these quirks:
julia> (Tuple{T,T} where Int64<:T<:Any) == Tuple{Int64, Int64}
false
These should probably also be true, since T >: lb
closes the UnionAll range (if I've thought it through correctly)
Edit: There are also examples without lower bounds:
julia> Union{Ref{Union{Int,String}}, Ref{<:Int}, Ref{<:String}} == Ref{<:Union{Int,String}}
false
UnionAll
s and Union
s are not equal, even if their effective extent may be, no? This is the same case, and I wouldn't necessarily expect them to be equal, since one is a type variable and the other a type:
julia> (Ref{T} where T<:Int) == Ref{Int}
false
I believe this should report true:
Interestingly, making the union larger does make it distribute eventually:
Reproduces on Julia 1.8 (and also 1.9 and master):