From 86246fb0a1d3465d8d1f9d697356bda308a55c44 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Sun, 22 Mar 2020 23:46:25 -0400 Subject: [PATCH] fix #35201, syntax error with named splatting inside function call (#35202) --- src/julia-syntax.scm | 2 ++ test/syntax.jl | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index aeeddc98630ced..991a2b5b9614dd 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1418,6 +1418,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)) diff --git a/test/syntax.jl b/test/syntax.jl index d4b7fd981b69ef..bc46f96dd16b3f 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -2213,3 +2213,8 @@ end Expr(:error, "invisible character \\u200b near column 3") @test Meta.parse("aa\UE0080", raise=false) == Expr(:error, "invalid character \"\Ue0080\" near column 3") + +# 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)