summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-03-04 22:56:12 +0100
committerAndreas Rumpf <rumpf_a@web.de>2016-03-04 22:56:12 +0100
commit13699c596ea40abc0df380a6d1b2f72cfda72372 (patch)
tree67e5b38c89ec2617f81f5abfe3270bb51ebd4b62 /compiler/vm.nim
parentdae175b3c4f0bfd577be0f8ef64f1723af0b04e1 (diff)
downloadNim-13699c596ea40abc0df380a6d1b2f72cfda72372.tar.gz
fixes #3872
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index b537700fa..7220e1b8e 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -1590,12 +1590,13 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode =
   for i in 1.. <sym.typ.len:
     tos.slots[i] = setupMacroParam(n.sons[i], sym.typ.sons[i])
 
-  if sfImmediate notin sym.flags:
-    let gp = sym.ast[genericParamsPos]
-    for i in 0 .. <gp.len:
+  let gp = sym.ast[genericParamsPos]
+  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)
-
+    elif gp[i].sym.typ.kind in {tyStatic, tyTypeDesc}:
+      globalError(n.info, "static[T] or typedesc nor supported for .immediate macros")
   # temporary storage:
   #for i in L .. <maxSlots: tos.slots[i] = newNode(nkEmpty)
   result = rawExecute(c, start, tos).regToNode