-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtyping is not reflexive and not transitive with triangular rule #24166
Comments
julia> Vector{Tuple{T, T} where Number<:T<:Number} <: Vector{Tuple{Number, Number}}
true on master, so at least that has been fixed. |
Thanks for these examples. In fact there was a TODO in the code asking for them. The diagonal rule has been tricky to get right. |
also put a band-aid on reflexivity of diagonal vars
@JeffBezanson Thanks for the reply and the fix! Related to this topic: should this example be julia> (Tuple{T, T} where T>:Int) <: Tuple{T, T} where T<:Number
false I would expect |
I had a radical idea the other day: Make I guess such a radical change is off the table for 1.0 anyways, but has it been seriously considered in the past? If so, what were the conclusions? |
also put a band-aid on reflexivity of diagonal vars
also put a band-aid on reflexivity of diagonal vars
@JeffBezanson This doesn't seem right: julia> Ref{Tuple{T, T} where T} <: Ref{Tuple{S, S}} where S
true As there doesn't exist single But this is fine as is: julia> Ref{Tuple{T} where T} <: Ref{Tuple{S}} where S
true In this case we can chose julia> (Tuple{T} where T) == Tuple{Any}
true |
If I remember correctly, the first should be OK, since |
But |
also put a band-aid on reflexivity of diagonal vars
I too have wondered as @martinholters about exploring invariant tuples (for v2.0 I suppose). |
Seems corrected now |
In julia 0.6.0 subtyping is not reflexive for some examples.
It seems to me that there is a problem with lower bounds in triangular dispatched cases, because these examples work fine:
Also, transitivity is broken:
Although, to my understanding,
T1 <: T2 == true
andT1 <: T3 == false
are correct, butT2 <: T3 == true
is not. So it's not really transitivity, but rather some problem withT2
on the left.Finally, this looks weird:
I don't see why vectors should not be in subtype relation.
Here is the version info:
@JeffBezanson
The text was updated successfully, but these errors were encountered: