Commit bd32cf1
committed
Allow GlobalRef and module qualified names in macro definitions (#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 #53515.1 parent 558f3bd commit bd32cf1
3 files changed
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2610 | 2610 | | |
2611 | 2611 | | |
2612 | 2612 | | |
2613 | | - | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
2614 | 2616 | | |
2615 | 2617 | | |
2616 | 2618 | | |
2617 | 2619 | | |
2618 | 2620 | | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
2619 | 2627 | | |
2620 | 2628 | | |
2621 | | - | |
| 2629 | + | |
2622 | 2630 | | |
2623 | 2631 | | |
2624 | 2632 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1347 | 1347 | | |
1348 | 1348 | | |
1349 | 1349 | | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
1350 | 1353 | | |
1351 | 1354 | | |
1352 | 1355 | | |
1353 | | - | |
| 1356 | + | |
1354 | 1357 | | |
1355 | 1358 | | |
1356 | 1359 | | |
1357 | 1360 | | |
1358 | | - | |
| 1361 | + | |
1359 | 1362 | | |
1360 | 1363 | | |
1361 | 1364 | | |
| |||
1364 | 1367 | | |
1365 | 1368 | | |
1366 | 1369 | | |
1367 | | - | |
1368 | | - | |
| 1370 | + | |
| 1371 | + | |
1369 | 1372 | | |
1370 | 1373 | | |
1371 | 1374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3637 | 3637 | | |
3638 | 3638 | | |
3639 | 3639 | | |
| 3640 | + | |
| 3641 | + | |
| 3642 | + | |
| 3643 | + | |
| 3644 | + | |
| 3645 | + | |
| 3646 | + | |
| 3647 | + | |
| 3648 | + | |
| 3649 | + | |
| 3650 | + | |
| 3651 | + | |
| 3652 | + | |
0 commit comments