diff options
author | Araq <rumpf_a@web.de> | 2014-02-03 17:35:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-02-03 17:35:03 +0100 |
commit | 99352c1e4c4889b3b1050ee496818fe25ca7d171 (patch) | |
tree | 968e70f5aefb214cb9ee9a9eef6debbcce38baf4 /compiler/vm.nim | |
parent | c30f6cfcf11cf5e61d708db476d7a6fcb62aab23 (diff) | |
download | Nim-99352c1e4c4889b3b1050ee496818fe25ca7d171.tar.gz |
macro tests almost green
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index aec76f307..61881a897 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1047,7 +1047,9 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): PNode = # XXX only supports 'name' for now; we can use regC to encode the # type trait operation decodeB(nkStrLit) - let typ = regs[rb].sym.typ.skipTypes({tyTypeDesc}) + var typ = regs[rb].typ + internalAssert typ != nil + while typ.kind == tyTypeDesc and typ.len > 0: typ = typ.sons[0] regs[ra].strVal = typ.typeToString(preferExported) of opcGlobalOnce: let rb = instr.regBx @@ -1178,7 +1180,7 @@ proc evalMacroCall*(module: PSym, n, nOrig: PNode, sym: PSym): PNode = # doesn't end up in the parameter: #InternalAssert tos.slots.len >= L # return value: - tos.slots[0] = newNodeIT(nkNilLit, n.info, sym.typ.sons[0]) + tos.slots[0] = newNodeIT(nkEmpty, n.info, sym.typ.sons[0]) # setup parameters: for i in 1 .. < min(tos.slots.len, L): tos.slots[i] = setupMacroParam(n.sons[i]) |