-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
process non-language pragma nodes in generics (#24254)
fixes #18649, refs #24183 Same as in #24183 for templates, we now process pragma nodes in generics so that macro symbols are captured and the pragma arguments are checked, but ignoring language pragma keywords. A difference is that we cannot process call nodes as is, we have to process their children individually so that the early untyped macro/template instantiation in generics does not kick in.
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
macro aMacro*(u:untyped):untyped = | ||
echo "in macro" | ||
result = u |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import mpragma1 | ||
proc p*[T]() = | ||
proc inner() {.aMacro.} = | ||
discard | ||
inner() | ||
discard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
discard """ | ||
nimout: ''' | ||
in macro | ||
''' | ||
""" | ||
|
||
# issue #18649 | ||
|
||
import mpragma2 | ||
p[string]() |