mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
23 lines
455 B
Nim
23 lines
455 B
Nim
import std/macros
|
|
import stdtest/testutils
|
|
|
|
macro test1(prc: untyped): untyped =
|
|
assertAll:
|
|
prc.params.len == 2
|
|
prc.params[1].len == 4
|
|
prc.pragma.len == 2
|
|
|
|
prc.params = nnkFormalParams.newTree(
|
|
ident("int")
|
|
)
|
|
prc.pragma = newEmptyNode()
|
|
|
|
assertAll:
|
|
prc.params.len == 1
|
|
prc.pragma.len == 0
|
|
prc
|
|
|
|
proc test(a, b: int): int {.gcsafe, raises: [], test1.} = 5
|
|
|
|
type hello = proc(a, b: int): int {.gcsafe, raises: [], test1.}
|