Fix overload resolution for pragmas evaluation (#8902)

Fixes #6448
Fixes #4384
This commit is contained in:
LemonBoy 2018-10-09 19:58:23 +02:00 • committed by Andreas Rumpf
commit 33458894da
8 changed files with 66 additions and 33 deletions

3
tests/pragmas/foobar.nim Normal file
View file

@ -0,0 +1,3 @@
import macros
macro async*(body: untyped): untyped =
return newStmtList()

3
tests/pragmas/t4384.nim Normal file
View file

@ -0,0 +1,3 @@
macro testMacro(body: untyped): untyped = discard
macro testMacro(s: string, body: untyped): untyped = discard
proc foo() {.testMacro: "foo".} = discard

16
tests/pragmas/t6448.nim Normal file
View file

@ -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()