-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
scope of keyword argument default values #17240
Comments
Could you provide the output of
This will also fail with an |
I think whether it is intended or not, f(a=a) and f(;a=a) should be consistent: both are OK or both are error. Current situation is confusing. |
+1 for consistent behaviour. (obviously) |
Tentativly marking this as a regression due for 0.5. |
+1 for consistency too, but it fails on Julia 0.4.5, so it's not a regression. Furthermore, the docs say it's intended behaviour
I don't understand why all keyword arguments are in scope if their value is undefined... |
I'm all for changing this in the future, but it will have to be in 0.6. |
Resolved: change to " |
This matches the behavior of optional positional arguments.
This matches the behavior of optional positional arguments.
This matches the behavior of optional positional arguments.
This matches the behavior of optional positional arguments.
fix #17240, evaluate keyword argument defaults in successive scopes
a=1
f(;a=a)=a
f() will generate "UndefVarError" error.
There is no problem if it is a normal argument.
The text was updated successfully, but these errors were encountered: