-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviormacros@macros@macros
Description
MWE:
macro foo()
quote
function bar(val)
@inline identity(nothing)
end
end
end
@foo
ERROR: LoadError: syntax: local variable name "#9#val" conflicts with an argument
Using any other variable name than val
makes this work. Probably suspect:
Lines 846 to 859 in 7eb9615
function annotate_meta_def_or_block(@nospecialize(ex), meta::Symbol) | |
inner = unwrap_macrocalls(ex) | |
if is_function_def(inner) | |
# annotation on a definition | |
return esc(pushmeta!(ex, meta)) | |
else | |
# annotation on a block | |
return Expr(:block, | |
Expr(meta, true), | |
Expr(:local, Expr(:(=), :val, esc(ex))), | |
Expr(meta, false), | |
:val) | |
end | |
end |
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviormacros@macros@macros