Skip to content

Reflection functions should handle UnionAll #20872

@yuyichao

Description

@yuyichao

From #20869

julia> foo{N}(::Val{N}, ::Type{Val{N}}) = true
foo (generic function with 1 method)

julia> Method[m[3] for m in Base._methods_by_ftype(Tuple{typeof(foo),Val{N},Type{Val{N}}} where N, -1, typemax(UInt))]
1-element Array{Method,1}:
 foo(::Val{N}, ::Type{Val{N}}) where N in Main at REPL[1]:1

julia> methods(foo, Tuple{Val{N},Type{Val{N}}} where N)
ERROR: type UnionAll has no field parameters
Stacktrace:
 [1] to_tuple_type(::Any) at ./reflection.jl:466
 [2] methods(::Any, ::Any) at ./reflection.jl:582

Metadata

Metadata

Assignees

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