You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> a = Type{Tuple{UnitRange{Int64}, Symbol, X} where {X}}
Type{Tuple{UnitRange{Int64}, Symbol, X} where X}
julia> b = Type{Tuple{UnitRange{Int64}, Symbol, Any}}
Type{Tuple{UnitRange{Int64}, Symbol, Any}}
julia> c = DataType
DataType
julia> a <:b
true
julia> a <:c
false
julia> b <:a
true
julia> b <:c
true
julia> c <:a
false
julia> c <:b
false
To be explicit, this is the cause of unsoundness in inference:
foo(x::Type{Tuple{Integer}}, y::DataType) = (@noinlinerand(Bool)) ? x : y
functionbar()
A = Core.compilerbarrier(:type, Tuple{X} where X<:Integer)
B = Core.compilerbarrier(:type, Int)
T =@noinlinefoo(A, B)
@show T
@show T isa DataType
return T
end
julia>@showbar() isa DataType;
T = Tuple{X} where X<:Integer
T isa DataType =truebar() isa DataType =false
Sometimes transitivity issues are benign, but not in this case.
So we have
(a <: b) && (b <: c)
, but!(a <: c)
.See also comments by @topolarity here: #57631 (comment)
The text was updated successfully, but these errors were encountered: