Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/macroexpand.scm
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@
(let ((parent-scope (cons (list env m) parent-scope))
(body (cadr e))
(m (caddr e)))
(resolve-expansion-vars-with-new-env body env m parent-scope inarg #t)))
(resolve-expansion-vars-with-new-env body '() m parent-scope inarg #t)))
((tuple)
(cons (car e)
(map (lambda (x)
Expand Down
26 changes: 26 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,32 @@ end
x6074 = 6074
@test @X6074() == 6074

# issue #43151
macro X43151_nested()
quote my_value = "from_nested_macro" end
end
macro X43151_parent()
quote
my_value = "from_parent_macro"
@X43151_nested()
my_value
end
end
@test @X43151_parent() == "from_parent_macro"

# also issue #43151
macro X43151_nested_escaping()
quote $(esc(:my_value)) = "from_nested_macro" end
end
macro X43151_parent_escaping()
quote
my_value = "from_parent_macro"
@X43151_nested_escaping()
my_value
end
end
@test @X43151_parent_escaping() == "from_nested_macro"

# issue #5536
test5536(a::Union{Real, AbstractArray}...) = "Splatting"
test5536(a::Union{Real, AbstractArray}) = "Non-splatting"
Expand Down