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

Honoring constraint on parametric type's parameter in UnionAll type #40952

Open
wsshin opened this issue May 26, 2021 · 0 comments
Open

Honoring constraint on parametric type's parameter in UnionAll type #40952

wsshin opened this issue May 26, 2021 · 0 comments

Comments

@wsshin
Copy link
Contributor

wsshin commented May 26, 2021

Consider the following definition of a parametric type named MyType:

julia> VERSION
v"1.6.1-pre.1"

julia> struct MyType{R<:Real}
           x::R
       end

Now, we get

julia> (MyType{R} where {R<:Real}) <: MyType
true

but

julia> (MyType{R} where {R}) <: MyType
false

Because the parameter R of MyType must be a subtype of Real by definition, it will be nice if the last code returns true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant