Skip to content

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 29, 2024

The following is currently an error:

julia> module MyMacroModule
           macro mymacro end
       end
Main.MyMacroModule

julia> macro MyMacroModule.mymacro()
           1
       end
ERROR: syntax: invalid macro definition around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1

Discussing with Jeff, we didn't think there was any good reason not to allow this, just a missing case in lowering. It's probably not particularly useful (unlike the corresponding case for functions that is used all the time), but it came up in writing a test case for #53515.

The following is currently an error:
```
julia> module MyMacroModule
           macro mymacro end
       end
Main.MyMacroModule

julia> macro MyMacroModule.mymacro()
           1
       end
ERROR: syntax: invalid macro definition around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
```

Discussing with Jeff, we didn't think there was any good reason
not to allow this, just a missing case in lowering. It's probably
not particularly useful (unlike the corresponding case for functions
that is used all the time), but it came up in writing a test case for #53515.
@Keno Keno requested a review from JeffBezanson February 29, 2024 20:30
@vtjnash vtjnash added compiler:lowering Syntax lowering (compiler front end, 2nd stage) feature Indicates new feature / enhancement requests labels Mar 1, 2024
@Keno Keno merged commit 136f018 into master Mar 1, 2024
@Keno Keno deleted the kf/globalrefmacronames branch March 1, 2024 06:32
tecosaur pushed a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
…aLang#53535)

The following is currently an error:
```
julia> module MyMacroModule
           macro mymacro end
       end
Main.MyMacroModule

julia> macro MyMacroModule.mymacro()
           1
       end
ERROR: syntax: invalid macro definition around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
```

Discussing with Jeff, we didn't think there was any good reason not to
allow this, just a missing case in lowering. It's probably not
particularly useful (unlike the corresponding case for functions that is
used all the time), but it came up in writing a test case for JuliaLang#53515.
Keno added a commit that referenced this pull request Mar 20, 2024
The following is currently an error:
```
julia> module MyMacroModule
           macro mymacro end
       end
Main.MyMacroModule

julia> macro MyMacroModule.mymacro()
           1
       end
ERROR: syntax: invalid macro definition around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
```

Discussing with Jeff, we didn't think there was any good reason not to
allow this, just a missing case in lowering. It's probably not
particularly useful (unlike the corresponding case for functions that is
used all the time), but it came up in writing a test case for #53515.
mkitti pushed a commit to mkitti/julia that referenced this pull request Apr 13, 2024
…aLang#53535)

The following is currently an error:
```
julia> module MyMacroModule
           macro mymacro end
       end
Main.MyMacroModule

julia> macro MyMacroModule.mymacro()
           1
       end
ERROR: syntax: invalid macro definition around REPL[2]:1
Stacktrace:
 [1] top-level scope
   @ REPL[2]:1
```

Discussing with Jeff, we didn't think there was any good reason not to
allow this, just a missing case in lowering. It's probably not
particularly useful (unlike the corresponding case for functions that is
used all the time), but it came up in writing a test case for JuliaLang#53515.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:lowering Syntax lowering (compiler front end, 2nd stage) feature Indicates new feature / enhancement requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants