diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/compile/tmacrostmt.nim | 9 | ||||
-rw-r--r-- | tests/reject/tnicerrorforsymchoice.nim | 18 |
2 files changed, 27 insertions, 0 deletions
diff --git a/tests/compile/tmacrostmt.nim b/tests/compile/tmacrostmt.nim index 69b49f692..d9c70197d 100644 --- a/tests/compile/tmacrostmt.nim +++ b/tests/compile/tmacrostmt.nim @@ -15,3 +15,12 @@ else: return tkUnknown case_token: inc i + +#bug #488 + +macro foo: stmt = + var exp = newCall("whatwhat", newIntLitNode(1)) + if compiles(getAst(exp)): return exp + else: echo "Does not compute!" + +foo() diff --git a/tests/reject/tnicerrorforsymchoice.nim b/tests/reject/tnicerrorforsymchoice.nim new file mode 100644 index 000000000..bc271dcab --- /dev/null +++ b/tests/reject/tnicerrorforsymchoice.nim @@ -0,0 +1,18 @@ +discard """ + line: 18 + errormsg: "type mismatch: got (proc (TScgi) | proc (PAsyncSocket, PStringTable, string))" +""" + +#bug #442 +import scgi, sockets, asyncio, strtabs +proc handleSCGIRequest[TScgi: TScgiState | PAsyncScgiState](s: TScgi) = + nil +proc handleSCGIRequest(client: PAsyncSocket, headers: PStringTable, + input: string) = + nil + +proc test(handle: proc (client: PAsyncSocket, headers: PStringTable, + input: string), b: int) = + nil + +test(handleSCGIRequest) |