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

Name mangling in errors for functions with keyword argument #7479

Closed
joehuchette opened this issue Jul 1, 2014 · 4 comments
Closed

Name mangling in errors for functions with keyword argument #7479

joehuchette opened this issue Jul 1, 2014 · 4 comments
Labels
keyword arguments f(x; keyword=arguments)

Comments

@joehuchette
Copy link
Member

julia> foo(x::Int;y=false) = (true &&& false)
foo (generic function with 1 method)

julia> foo(1)
ERROR: error compiling foo: unsupported or misplaced expression & in function foo

julia> foo(1;y=true)
ERROR: error compiling __foo#1__: unsupported or misplaced expression & in function __foo#1__
@ihnorton
Copy link
Member

ihnorton commented Jul 1, 2014

the syntax error is in the function body:

julia> true &&& false
ERROR: unsupported or misplaced expression &

@joehuchette
Copy link
Member Author

Yes, I'm aware about the syntax error, I opened this because of the __foo#1__ in the second error message. Not hugely annoying, but seems like unexpected behavior.

@ihnorton
Copy link
Member

ihnorton commented Jul 1, 2014

I think this is basically expected right now. see #2758.

@JeffBezanson JeffBezanson added the keyword arguments f(x; keyword=arguments) label Jul 20, 2017
@JeffBezanson
Copy link
Sponsor Member

Basically a dup of #13599, and I'll add a better syntax error for this case.

JeffBezanson added a commit that referenced this issue Jul 21, 2017
better syntax error for `&&&`, fixes #7479
jeffwong pushed a commit to jeffwong/julia that referenced this issue Jul 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keyword arguments f(x; keyword=arguments)
Projects
None yet
Development

No branches or pull requests

3 participants