implemented opcTypeTrait

This commit is contained in:
Araq 2013-08-22 19:28:34 +02:00
commit cf38d635bf
3 changed files with 26 additions and 17 deletions

View file

@ -699,8 +699,11 @@ proc genMagic(c: PCtx; n: PNode; dest: var TDest) =
of mExpandToAst:
InternalError(n.info, "cannot generate code for: " & $m)
of mTypeTrait:
InternalError(n.info, "cannot generate code for: " & $m)
let tmp = c.genx(n.sons[1])
if dest < 0: dest = c.getTemp(n.typ)
c.gABx(n, opcSetType, tmp, c.genType(n.sons[1]))
c.gABC(n, opcTypeTrait, dest, tmp)
c.freeTemp(tmp)
of mIs:
InternalError(n.info, "cannot generate code for: " & $m)
of mSlurp: genUnaryABC(c, n, dest, opcSlurp)