diff options
Diffstat (limited to 'tests/macros/tmacro2.nim')
-rw-r--r-- | tests/macros/tmacro2.nim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/macros/tmacro2.nim b/tests/macros/tmacro2.nim index 17f312925..1ad63ec8c 100644 --- a/tests/macros/tmacro2.nim +++ b/tests/macros/tmacro2.nim @@ -12,7 +12,7 @@ proc testBlock(): string {.compileTime.} = echo "outer block" result = "ta-da" -macro mac(n: expr): expr = +macro mac(n: typed): string = let n = callsite() expectKind(n, nnkCall) expectLen(n, 2) @@ -26,3 +26,11 @@ const t = mac("HEllo World") echo s, " ", t +#----------------------------------------------------------------------------- +# issue #15326 +macro m(n:typed):auto = + result = n + +proc f[T](x:T): T {.m.} = x + +discard f(3) \ No newline at end of file |