-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
splitarg incompatible with kwargs on 1.7 #177
Comments
MWE, for convenience: julia> f(args::Any...) = 10
f (generic function with 2 methods)
julia> f(;args::Any...) = 10
ERROR: syntax: "args::Any" is not a valid function argument name around REPL[24]:1
Stacktrace:
[1] top-level scope
@ REPL[24]:1 Man, that sucks. First things first, can we identify the Julia PR that changed this? I'm not sure that this isn't simply an unintended change, that could potentially be reverted in a julia patch release. Second... There's another solution, being that |
JuliaLang/julia#43625. The more I think about it, the more I believe that this was unintended. The error message certainly doesn't sound like a carefully thought deprecation! |
I'm not sure it's even possible for the symbol |
Let's wait for Julia's feedback. Julia 1.7 introduced a special case (all args can be typed except...), which forces us to introduce another special-case, which might well force other libraries downstream to special-case |
Update from JuliaLang/julia#43625: Jeff said that the new behaviour wasn't exactly intentional, but that it's in a sense more correct than the old, so we'll go ahead with #178 |
Therefore, it is no longer safe to do
funcdef[:kwargs] = map(arg->combinearg(splitarg(arg)...), funcdef[:kwargs]
, since this would transform a definition likef(;kwargs...)
tof(;kwargs::Any...)
which is no longer allowed in Julia 1.7. I don't know why that's no longer allowed, but from the REPL:The text was updated successfully, but these errors were encountered: