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

Certain parametric constraints fail with kwmethod #9

Closed
MasonProtter opened this issue Jan 26, 2020 · 1 comment
Closed

Certain parametric constraints fail with kwmethod #9

MasonProtter opened this issue Jan 26, 2020 · 1 comment

Comments

@MasonProtter
Copy link

Sorry this isn't the cleanest example, but I couldn't boil it down any more. This errors:

julia> using KeywordDispatch

julia> @kwdispatch f(x::T) where {T}

julia> @kwmethod f(x::T; y::Type{TI}) where {T, TI <: Vector{T}} = y
ERROR: UndefVarError: TI not defined
Stacktrace:
 [1] top-level scope at /Users/mason/.julia/packages/KeywordDispatch/Hhjer/src/KeywordDispatch.jl:253

whereas it does not without the @kwmethod:

julia> f(x::T; y::Type{TI}) where {T, TI <: Vector{T}} = y
f (generic function with 1 method)
@simonbyrne
Copy link
Owner

I sort of fixed this in #9. Unfortunately it looks like you can't use Type{...} in signatures, I've opened a new issue (#10).

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

2 participants