From 39db8a1e8da1db20aa0728d9f61cd293786a04c6 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 24 May 2019 16:39:29 -0400 Subject: [PATCH] fix #32121, macro hygiene bug in named tuples (cherry picked from commit d8798be07e24e27fbc29a6ee824f4990a7e94f39) --- src/macroexpand.scm | 8 ++++++++ test/syntax.jl | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/macroexpand.scm b/src/macroexpand.scm index 4349e3a5b67d63..1c1502e477c74a 100644 --- a/src/macroexpand.scm +++ b/src/macroexpand.scm @@ -414,6 +414,14 @@ (body (cadr e)) (m (caddr e))) (resolve-expansion-vars-with-new-env body env m parent-scope inarg #t))) + ((tuple) + (cons (car e) + (map (lambda (x) + (if (assignment? x) + `(= ,(unescape (cadr x)) + ,(resolve-expansion-vars-with-new-env x env m parent-scope inarg)) + (resolve-expansion-vars-with-new-env x env m parent-scope inarg))) + (cdr e)))) ;; todo: trycatch (else diff --git a/test/syntax.jl b/test/syntax.jl index c557028dbf3170..5b45a61677579a 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1741,6 +1741,9 @@ end end end)), :thunk) +# issue #32121 +@test @id28992((a=1, b=2)) === (a=1, b=2) + # issue #30030 let x = 0 @test (a=1, b=2, c=(x=3)) == (a=1, b=2, c=3)