Skip to content

Commit

Permalink
fix #24289, missing argument to resolve-expansion-vars-with-new-env
Browse files Browse the repository at this point in the history
… in macroexpand (#24290)
  • Loading branch information
JeffBezanson authored Oct 24, 2017
1 parent 9f5ec71 commit 6475ae9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,9 @@
((assignment? arg)
`(global
(= ,(unescape (cadr arg))
,(resolve-expansion-vars-with-new-env (caddr arg) env m inarg))))
,(resolve-expansion-vars-with-new-env (caddr arg) env m parent-scope inarg))))
(else
`(global ,(resolve-expansion-vars-with-new-env arg env m inarg))))))
`(global ,(resolve-expansion-vars-with-new-env arg env m parent-scope inarg))))))
((using import importall export meta line inbounds boundscheck simdloop gc_preserve gc_preserve_end) (map unescape e))
((macrocall) e) ; invalid syntax anyways, so just act like it's quoted.
((symboliclabel) e)
Expand Down
6 changes: 6 additions & 0 deletions test/parse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1376,3 +1376,9 @@ end
@test parse("@foo [1] + [2]") == parse("@foo([1] + [2])")
@test parse("@Mdl.foo[1] + [2]") == parse("@Mdl.foo([1]) + [2]")
@test parse("@Mdl.foo [1] + [2]") == parse("@Mdl.foo([1] + [2])")

# issue #24289
macro m24289()
:(global $(esc(:x24289)) = 1)
end
@test (@macroexpand @m24289) == :(global x24289 = 1)

0 comments on commit 6475ae9

Please sign in to comment.