diff options
author | Araq <rumpf_a@web.de> | 2017-05-09 17:26:54 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-05-09 17:26:54 +0200 |
commit | ae7fd0fcedd5db50142c6d76fc3b9c3e6dfa3ad7 (patch) | |
tree | 2f2a4de9e6041950cae0b66217660ceee24f07a1 /compiler/vm.nim | |
parent | 79b12faf9ec63d04a7b3a58134e27b4ffb60bcaf (diff) | |
parent | fa3436fb657141127038d88431b4aad113c27cf6 (diff) | |
download | Nim-ae7fd0fcedd5db50142c6d76fc3b9c3e6dfa3ad7.tar.gz |
Merge branch 'devel' of github.com:nim-lang/Nim into devel
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 6a9545193..3c475cf57 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1651,8 +1651,16 @@ proc evalMacroCall*(module: PSym; cache: IdentCache, n, nOrig: PNode, for i in 0 .. <gp.len: if sfImmediate notin sym.flags: let idx = sym.typ.len + i - tos.slots[idx] = setupMacroParam(n.sons[idx], gp[i].sym.typ) + if idx < n.len: + tos.slots[idx] = setupMacroParam(n.sons[idx], gp[i].sym.typ) + else: + dec(evalMacroCounter) + c.callsite = nil + localError(n.info, "expected " & $gp.len & + " generic parameter(s)") elif gp[i].sym.typ.kind in {tyStatic, tyTypeDesc}: + dec(evalMacroCounter) + c.callsite = nil globalError(n.info, "static[T] or typedesc nor supported for .immediate macros") # temporary storage: #for i in L .. <maxSlots: tos.slots[i] = newNode(nkEmpty) |