diff options
Diffstat (limited to 'tests/pragmas')
-rw-r--r-- | tests/pragmas/foobar.nim | 3 | ||||
-rw-r--r-- | tests/pragmas/t4384.nim | 3 | ||||
-rw-r--r-- | tests/pragmas/t6448.nim | 16 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/pragmas/foobar.nim b/tests/pragmas/foobar.nim new file mode 100644 index 000000000..46032e187 --- /dev/null +++ b/tests/pragmas/foobar.nim @@ -0,0 +1,3 @@ +import macros +macro async*(body: untyped): untyped = + return newStmtList() diff --git a/tests/pragmas/t4384.nim b/tests/pragmas/t4384.nim new file mode 100644 index 000000000..e6b193f79 --- /dev/null +++ b/tests/pragmas/t4384.nim @@ -0,0 +1,3 @@ +macro testMacro(body: untyped): untyped = discard +macro testMacro(s: string, body: untyped): untyped = discard +proc foo() {.testMacro: "foo".} = discard diff --git a/tests/pragmas/t6448.nim b/tests/pragmas/t6448.nim new file mode 100644 index 000000000..61e4a35d9 --- /dev/null +++ b/tests/pragmas/t6448.nim @@ -0,0 +1,16 @@ +discard """ + line: 9 + errormsg: '''ambiguous call; both foobar.async''' +""" + +import foobar +import asyncdispatch, macros + +proc bar() {.async.} = + echo 42 + +proc foo() {.async.} = + await bar() + +asyncCheck foo() +runForever() |