We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In the code below definitions f1 and f2 should be equivalent I think. However, f1 is a syntax error, while f2 works as expected.
f1
f2
julia> h(x; k=1) = (x, k) h (generic function with 1 method) julia> f1(c) = h((;c...), k=true) ERROR: syntax: "..." expression outside call Stacktrace: [1] top-level scope at REPL[8]:1 julia> f2(c) = (nt=(;c...); h(nt, k=true)) f2 (generic function with 1 method) julia> f2(Dict(:a=>1, :b=>2)) ((a = 1, b = 2), true)
It seems that a parser does not correctly recognize that ... in this case is used in a nested NamedTuple constructor call within a call to h.
...
NamedTuple
h
The problem seems to be present only if the call involves keyword arguments, so e.g.
julia> f1(c) = h((;c...), true) f1 (generic function with 1 method)
parses correctly.
Also
julia> f1(c) = h(;c..., k=true) f1 (generic function with 1 method)
parses, but it gives a different definition of course.
The text was updated successfully, but these errors were encountered:
fix #35201, syntax error with named splatting inside function call
d715581
fix #35201, syntax error with named splatting inside function call (#…
59d7522
…35202)
23e8527
…35202) (cherry picked from commit 59d7522)
fix JuliaLang#35201, syntax error with named splatting inside functio…
86246fb
…n call (JuliaLang#35202)
fa84a6f
7eb4423
JeffBezanson
Successfully merging a pull request may close this issue.
In the code below definitions
f1
andf2
should be equivalent I think.However,
f1
is a syntax error, whilef2
works as expected.It seems that a parser does not correctly recognize that
...
in this case is used in a nestedNamedTuple
constructor call within a call toh
.The problem seems to be present only if the call involves keyword arguments, so e.g.
parses correctly.
Also
parses, but it gives a different definition of course.
The text was updated successfully, but these errors were encountered: