fix for return in macro (#9666); fixes #5874

This commit is contained in:
Arne Döring 2019-05-20 12:18:54 +02:00 • committed by Andreas Rumpf
commit aeb6ec27de
5 changed files with 41 additions and 8 deletions

View file

@ -1,8 +1,8 @@
discard """
nimout: '''
instantiation 1 with None and None
instantiation 2 with None and None
instantiation 3 with None and None
instantiation 1 with typeDesc[int] and typeDesc[float]
instantiation 2 with typeDesc[float] and typeDesc[string]
instantiation 3 with typeDesc[string] and typeDesc[string]
counter: 3
'''
output: "int\nfloat\nint\nstring"
@ -14,7 +14,7 @@ var counter {.compileTime.} = 0
macro makeBar(A, B: typedesc): typedesc =
inc counter
echo "instantiation ", counter, " with ", A.name, " and ", B.name
echo "instantiation ", counter, " with ", A.getTypeInst.repr, " and ", B.getTypeInst.repr
result = A
type