Skip to content

Commit

Permalink
fix #35201, syntax error with named splatting inside function call (#…
Browse files Browse the repository at this point in the history
…35202)

(cherry picked from commit 59d7522)
  • Loading branch information
JeffBezanson authored and KristofferC committed Mar 23, 2020
1 parent 7ccda0e commit 23e8527
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,8 @@
`(,(car x) ,(arg-to-temp (cadr x))))
((or (eq? (car x) 'kw) (and tup (eq? (car x) '=)))
`(,(car x) ,(cadr x) ,(arg-to-temp (caddr x))))
((eq? (car x) 'parameters)
`(parameters ,@(map arg-to-temp (cdr x))))
((eq? (car x) 'tuple)
(let ((tmp (remove-argument-side-effects x #t)))
(set! a (revappend (cdr tmp) a))
Expand Down
5 changes: 5 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1979,3 +1979,8 @@ f33987(args::(Vararg{Any, N} where N); kwargs...) = args
end
pop = 1
end == 1

# issue #35201
h35201(x; k=1) = (x, k)
f35201(c) = h35201((;c...), k=true)
@test f35201(Dict(:a=>1,:b=>3)) === ((a=1,b=3), true)

0 comments on commit 23e8527

Please sign in to comment.