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 wrong (because of variable bounds?) #26654

Closed
ulysses4ever opened this Issue Mar 29, 2018 · 2 comments

Comments

2 participants
@ulysses4ever

ulysses4ever commented Mar 29, 2018

Julia used to say true (e.g. in 0.6.2) here:

Ref{Union{Int64, Ref{Number}}} <: Ref{Union{Ref{T}, T}} where T

but current master, quite reasonably, says false. If you change, though, Ref to Val it is true again:

Ref{Union{Val{Number}, Int64}} <: Ref{Union{Val{T}, T}} where T

Which seems to be a bug.

@ulysses4ever ulysses4ever changed the title from Subtyping is wrong (because of variable bounds)? to Subtyping is wrong (because of variable bounds?) Mar 29, 2018

@JeffBezanson

This comment has been minimized.

Member

JeffBezanson commented Mar 29, 2018

Seems to be related to Ref being an abstract type.

@JeffBezanson JeffBezanson self-assigned this Mar 29, 2018

@JeffBezanson

This comment has been minimized.

Member

JeffBezanson commented Apr 3, 2018

...which affects the order of the Union components. When the types "line up":

Ref{Union{Val{Number}, Int64}} <: Ref{Union{Val{T}, T}} where T

then we say true, but with the other order on the left:

Ref{Union{Int64, Val{Number}}} <: Ref{Union{Val{T}, T}} where T

we say false.

@JeffBezanson JeffBezanson added the bug label Apr 3, 2018

JeffBezanson added a commit that referenced this issue Apr 3, 2018

JeffBezanson added a commit that referenced this issue Apr 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment