-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference
Description
I guess this issue should be raised before, but I couldn't find an issue that discusses this.
When working on #44512 (in particularity this issue), I found the following isa check doesn't work as I expected:
julia> Type{Int} <: DataType
true
julia> Int isa Type{Int}
true
julia> (Int,) isa Tuple{DataType} # expected
true
julia> (Int,) isa Tuple{Type{Int}} # I expected this to return `true`
falseSo in essence Tuple-type whose parameter contains Type-type doesn't seem to follow the covariant rule.
This issue leads to the ERROR: fatal error in type inference (type bound) error in #44512 when we try to union-split Base.indexed_iterate(::Union{Tuple{Nothing, Nothing, Nothing}, Tuple{Any, Union{Type{AbstractContinuousSystem}, Type{AbstractDiscreteSystem}}, Any}}, ...) callsite.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorcompiler:inferenceType inferenceType inference