Skip to content

Can't dispatch on Type{} #10

@simonbyrne

Description

@simonbyrne

From #9:

julia> using KeywordDispatch

julia> @kwdispatch f()

julia> @kwmethod f(;a::Type{Float64}) = 1

julia> f(a=Float64)
ERROR: KeywordMethodError: no keyword method matching f(; a::DataType)
Stacktrace:
 [1] kwcall(::NamedTuple{(:a,),Tuple{DataType}}, ::Function) at /Users/simon/src/KeywordDispatch.jl/src/KeywordDispatch.jl:102
 [2] f(; kwargs::Base.Iterators.Pairs{Symbol,DataType,Tuple{Symbol},NamedTuple{(:a,),Tuple{DataType}}}) at /Users/simon/src/KeywordDispatch.jl/src/KeywordDispatch.jl:177
 [3] top-level scope at REPL[5]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions