-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
fixes #24641; quote do
captures no variables without backticks
#24642
base: devel
Are you sure you want to change the base?
Conversation
quote do
captures no variables under current macrosquote do
captures no variables without backticks under current macros
related to #8574 |
quote do
captures no variables without backticks under current macrosquote do
captures no variables without backticks
It allows top level syms to be captured for backwards compatibility, but still benefits from not capturing local varibles in macros/procs result = quote do:
initFromJson(`baseTyp`(`dst`), `jsonNode`, `jsonPath`) This is wrong because |
The latest changes skip the current owner scope if the kind of owner belongs to routine kinds |
Has the potential to break somebody's subtle macro trickery. Not sure what to do. |
No possible subtle macro trickery can depend on an internal compiler error happening. |
The diff doesn't contain any "removes |
fixes #24641
ref #17426
TODO:
This PR solves problems in nim-lang/RFCs#122
The quoted ast won't capture local variables from macros anymore. It solves #7323 which is a special case of capturing
result
. Then we can revert #7343 that did some hack onresult
.