Skip to content

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

Closed
@simonster

Description

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.

Activity

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

Metadata

Assignees

No one assigned

    Labels

    types and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions