diff --git a/src/macroexpand.scm b/src/macroexpand.scm index 77d0fbb1781ae..3ed334b2f4d27 100644 --- a/src/macroexpand.scm +++ b/src/macroexpand.scm @@ -419,7 +419,7 @@ (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 (caddr x) env m parent-scope inarg)) (resolve-expansion-vars-with-new-env x env m parent-scope inarg))) (cdr e)))) @@ -496,10 +496,17 @@ ((and (eq? (car e) '=) (not (function-def? e))) (append! (filter symbol? (decl-vars* (cadr e))) (find-assigned-vars-in-expansion (caddr e) #f))) + ((eq? (car e) 'tuple) + (apply append! (map (lambda (x) + (find-assigned-vars-in-expansion (if (assignment? x) + (caddr x) + x) + #f)) + (cdr e)))) (else (apply append! (map (lambda (x) (find-assigned-vars-in-expansion x #f)) - e))))) + (cdr e)))))) (define (keywords-introduced-by e) (let ((v (pattern-expand1 keywords-introduced-by-patterns e))) diff --git a/test/syntax.jl b/test/syntax.jl index 3b9f516157bdd..bc8b74df94ef5 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1850,6 +1850,9 @@ macro id28992(x) x end # issue #32121 @test @id28992((a=1, b=2)) === (a=1, b=2) +a32121 = 8 +b32121 = 9 +@test @id28992((a32121=a32121, b32121=b32121)) === (a32121=8, b32121=9) # issue #31596 f31596(x; kw...) = x