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

UndefVarError with both kwargs and type parameter chaining #21147

Closed
marius311 opened this issue Mar 24, 2017 · 2 comments
Closed

UndefVarError with both kwargs and type parameter chaining #21147

marius311 opened this issue Mar 24, 2017 · 2 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)

Comments

@marius311
Copy link
Contributor

marius311 commented Mar 24, 2017

On the latest master, I get,

julia> function foo(f::Tuple{A}; kwargs...) where {B,A<:Tuple{B}} end
ERROR: UndefVarError: B not defined

Getting rid of the kwargs fixes it, as does not doing parameter chaining; also, its not specific to Tuple, any other parametric type fails. Bug perhaps? (sorry if this is known or even not a bug, I couldn't find anything else searching)

@yuyichao yuyichao added the compiler:lowering Syntax lowering (compiler front end, 2nd stage) label Mar 24, 2017
@JeffBezanson JeffBezanson self-assigned this Mar 24, 2017
@JeffBezanson JeffBezanson added the bug Indicates an unexpected problem or unintended behavior label Mar 24, 2017
JeffBezanson added a commit that referenced this issue Mar 25, 2017
fix #21147, lowering of keyword args with chained static parameters
@marius311
Copy link
Contributor Author

Ahh and sorry I think there's a variant of this same thing that I missed originally that seems to still be an issue though, basically same thing but with optional positional args (checking now on 43fb9f0):

julia> function foo(f::Tuple{A}, g=1) where {B,A<:Tuple{B}} end
ERROR: UndefVarError: B not defined

@JeffBezanson
Copy link
Member

Thanks. Fixed.

JeffBezanson added a commit that referenced this issue Mar 25, 2017
fix other part of #21147, optional instead of keyword args
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

No branches or pull requests

3 participants