Skip to content

Commit

Permalink
Merge pull request #16102 from JuliaLang/jb/fix16096
Browse files Browse the repository at this point in the history
fix #16096, incorrect var renaming inside macrocall exprs in macroexpand
  • Loading branch information
JeffBezanson committed May 2, 2016
2 parents fe92747 + 14114f1 commit da7ac48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
((macrocall)
(if (or (eq? (cadr e) '@label) (eq? (cadr e) '@goto)) e
`(macrocall ,.(map (lambda (x)
(resolve-expansion-vars- x env m inarg))
(resolve-expansion-vars-with-new-env x env m inarg))
(cdr e)))))
((symboliclabel) e)
((symbolicgoto) e)
Expand Down
14 changes: 14 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3866,3 +3866,17 @@ function f16023()
x = 1
end
@test_throws UndefVarError f16023()

# issue #16096
module M16096
macro iter()
quote
@inline function foo(sub)
it = 1
end
end
end
end
let ex = expand(:(@M16096.iter))
@test !(isa(ex,Expr) && ex.head === :error)
end

0 comments on commit da7ac48

Please sign in to comment.