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

Dispatch issue with parametric methods where subtype constraint is a Type #12721

Closed
simonster opened this issue Aug 21, 2015 · 4 comments
Closed
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@simonster
Copy link
Member

Consider (on 0.4):

julia> f{T<:Type{Int}}(::T) = true;

julia> f(Float64)
true

I think this should be a MethodError. It seems like f is applicable for any DataType, not just Type{Int}.

On 0.3, f(Float64) is in fact a MethodError, but so is f(Int), which I would expect to work, so while the behavior has changed it doesn't seem like this is a regression.

@simonster simonster added the types and dispatch Types, subtyping and method dispatch label Aug 21, 2015
@JeffBezanson
Copy link
Member

I think this has the same root cause as #11327.

@JeffBezanson JeffBezanson changed the title Dispatch issue with parametric methods where subtype constraint is a type Dispatch issue with parametric methods where subtype constraint is a Type Aug 21, 2015
@JeffBezanson
Copy link
Member

This is now fixed. (Maybe by #18457 but might have been fixed before that.)

@tkelman
Copy link
Contributor

tkelman commented Jan 16, 2017

should add a test if there isn't one

@vtjnash vtjnash mentioned this issue Jan 16, 2017
53 tasks
@mauro3
Copy link
Contributor

mauro3 commented Jan 17, 2017

This is fixed on 0.4.7 already.

mauro3 added a commit to mauro3/julia that referenced this issue Jan 17, 2017
mauro3 added a commit to mauro3/julia that referenced this issue Jan 17, 2017
mauro3 added a commit to mauro3/julia that referenced this issue Jan 17, 2017
mauro3 added a commit to mauro3/julia that referenced this issue Jan 17, 2017
mauro3 added a commit to mauro3/julia that referenced this issue Jan 18, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#11803, JuliaLang#12721

Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved
yet but needs tests triggering it.
mauro3 added a commit to mauro3/julia that referenced this issue Jan 20, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#12721

For JuliaLang#11803 it was decidided that no tests are needed.

Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved
yet but needs new tests triggering it.
mauro3 added a commit to mauro3/julia that referenced this issue Jan 20, 2017
Added tests for issues JuliaLang#12580, JuliaLang#18348, JuliaLang#13165, JuliaLang#12721

For JuliaLang#11803 it was decidided that no tests are needed.

Enabled extra tests for JuliaLang#11840, however, that isssue is not resolved
yet but needs new tests triggering it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

4 participants