Skip to content
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

suboptimal and unexpected subtyping #54349

Open
nsajko opened this issue May 3, 2024 · 0 comments
Open

suboptimal and unexpected subtyping #54349

nsajko opened this issue May 3, 2024 · 0 comments
Labels
domain:types and dispatch Types, subtyping and method dispatch

Comments

@nsajko
Copy link
Contributor

nsajko commented May 3, 2024

julia> struct T{A, B<:AbstractVector} end

julia> T{<:Any,Vector{Int}} <: T  # OK
true

julia> struct S{A, B<:AbstractVector{A}} end

julia> S{<:Any,Vector{Int}} <: S  # !
false

julia> S{<:Any,Vector{<:Any}} <: S  # !
false

julia> S{T,Vector{T}} where {T} <: S  # a partial workaround
true

I guess this is caused by #54348?

@nsajko nsajko added the domain:types and dispatch Types, subtyping and method dispatch label May 3, 2024
@nsajko nsajko changed the title suboptimal and unexpected suboptimal subtyping suboptimal and unexpected subtyping May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

1 participant