Skip to content

macro hygiene bug #22307

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

Closed
vtjnash opened this issue Jun 9, 2017 · 1 comment
Closed

macro hygiene bug #22307

vtjnash opened this issue Jun 9, 2017 · 1 comment
Labels
macros @macros

Comments

@vtjnash
Copy link
Member

vtjnash commented Jun 9, 2017

this is a bit convoluted to come up with a good example, but macro hygiene is wrong for macros that return calls to macros:

# time: 2017-06-08 18:41:45 EDT
# mode: julia
        macro a()
          esc(:a)
        end
# time: 2017-06-08 18:41:58 EDT
# mode: julia
        macro b()
          :(@a)
        end
# time: 2017-06-08 18:42:16 EDT
# mode: julia
        function c()
          a = 1
          return @b
        end
# time: 2017-06-08 18:42:22 EDT
# mode: julia
        a = 2
        @test c() == 2

It seems like we're running hygiene over the AST before recursively expanding macros, whereas we should be doing it afterwards.

@JeffBezanson
Copy link
Member

Maybe a good opportunity to revisit #10940.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
macros @macros
Projects
None yet
Development

No branches or pull requests

3 participants