diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2018-10-09 19:58:23 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-10-09 19:58:23 +0200 |
commit | 33458894da13da7134604639c129273bfb0cb1c1 (patch) | |
tree | 76ed110300cb8cb104f4c51730650ce65a83ad79 /tests/pragmas | |
parent | ee14ace5d3f3ede9d47d60bd415e46a3fb121fb2 (diff) | |
download | Nim-33458894da13da7134604639c129273bfb0cb1c1.tar.gz |
Fix overload resolution for pragmas evaluation (#8902)
Fixes #6448 Fixes #4384
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() |