diff options
author | LemonBoy <LemonBoy@users.noreply.github.com> | 2019-02-06 11:35:44 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-02-06 11:35:44 +0100 |
commit | 6c8dee418072dbf047e6b21ab083547683656702 (patch) | |
tree | eb8435e8ce596ff42d16d771fd49d3dfab593c3c /tests | |
parent | 26255c72fd94da57c7208dc84e027a5de6693605 (diff) | |
download | Nim-6c8dee418072dbf047e6b21ab083547683656702.tar.gz |
Avoid evaluating macros twice in type sections (#10550)
Fixes #10548
Diffstat (limited to 'tests')
-rw-r--r-- | tests/macros/tmacrotypes.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/macros/tmacrotypes.nim b/tests/macros/tmacrotypes.nim index 734503e6b..b4d708240 100644 --- a/tests/macros/tmacrotypes.nim +++ b/tests/macros/tmacrotypes.nim @@ -23,3 +23,18 @@ checkType(voidProc(), "void") checkType(intProc(10, 20.0), "int") checkType(voidProc, "procTy") checkProcType(voidProc) + +# bug #10548 +block: + var c {.compileTime.} = 0 + + macro meshImpl(arg: typed): untyped = + inc c + result = arg + + type + Blub = int32 + Mesh = meshImpl(Club) + Club = Blub + + static: doAssert(c == 1) |