summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-08-22 19:28:34 +0200
committerAraq <rumpf_a@web.de>2013-08-22 19:28:34 +0200
commitcf38d635bf8e94abbc68cca55fd6deb6ebc3da5d (patch)
tree35d19cdf05ed9eff3cf6732d9d942a87c1df2698 /compiler/vm.nim
parent3940bd5b84ec41f91f784573c0b0e02bfa2f8bc9 (diff)
downloadNim-cf38d635bf8e94abbc68cca55fd6deb6ebc3da5d.tar.gz
implemented opcTypeTrait
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index c0ce047ea..e13d91e77 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -833,6 +833,12 @@ proc execute(c: PCtx, start: int) =
       regs[ra] = newSymNode(newSym(k.TSymKind, name.getIdent, c.module,
                             c.debug[pc]))
       incl(regs[ra].sym.flags, sfGenSym)
+    of opcTypeTrait:
+      # 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})
+      regs[ra].strVal = typ.typeToString(preferExported)
     inc pc
 
 proc evalStmt*(c: PCtx, n: PNode) =