Add isInstanceOf for generic procs to the macros module (#9730)
This commit is contained in:
parent
1cc8b7814d
commit
086676782a
8 changed files with 46 additions and 3 deletions
|
|
@ -274,6 +274,12 @@ when defined(nimHasSymOwnerInMacro):
|
|||
## result is also mnde of kind nnkSym if owner exists otherwise
|
||||
## nnkNilLit is returned
|
||||
|
||||
when defined(nimHasInstantiationOfInMacro):
|
||||
proc isInstantiationOf*(instanceProcSym, genProcSym: NimNode): bool {.magic: "SymIsInstantiationOf", noSideEffect.}
|
||||
## check if proc symbol is instance of the generic proc symbol
|
||||
## useful to check proc symbols against generic symbols
|
||||
## returned by `bindSym`
|
||||
|
||||
proc getType*(n: NimNode): NimNode {.magic: "NGetType", noSideEffect.}
|
||||
## with 'getType' you can access the node's `type`:idx:. A Nim type is
|
||||
## mapped to a Nim AST too, so it's slightly confusing but it means the same
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue