-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rename variable
used in inbounds
to avoid accidental collisions due to macro hygiene bug
#54613
base: master
Are you sure you want to change the base?
Conversation
…ue to macry hygiene bug
fd8fe07
to
fb6f579
Compare
@@ -861,9 +861,9 @@ end | |||
macro inbounds(blk) | |||
return Expr(:block, | |||
Expr(:inbounds, true), | |||
Expr(:local, Expr(:(=), :val, esc(blk))), | |||
Expr(:local, Expr(:(=), :val_49f6338b, esc(blk))), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gensym
? But as was pointed out in the original issue, the macro is fine as written, the current behavior is a bug. Maybe leave a comment that effect?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gensym
is not defined during bootstrapping so this seemed easiest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is off-topic, but I wonder if reserved words might be useful in these cases. cf. (PR #51215)
Of course, we still need to be careful to avoid collisions in Base
and stdlibs.
end | ||
end | ||
|
||
@testset "inbounds hygien confusion" begin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@testset "inbounds hygien confusion" begin | |
@testset "inbounds hygiene confusion" begin |
variable
used in inbounds
to avoid accidental collisions due to macry hygiene bugvariable
used in inbounds
to avoid accidental collisions due to macro hygiene bug
Fixes #54417