Skip to content

Commit

Permalink
fix #32121, macro hygiene bug in named tuples
Browse files Browse the repository at this point in the history
(cherry picked from commit d8798be)
  • Loading branch information
JeffBezanson committed Jun 6, 2019
1 parent 50f7de1 commit 39db8a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 39db8a1

Please sign in to comment.