type trais used to work only on user-defined types. see #202

This commit is contained in:
Zahary Karadjov 2012-09-13 00:33:01 +03:00
commit 9e4254e4de
2 changed files with 16 additions and 3 deletions

View file

@ -864,8 +864,7 @@ proc evalTypeTrait*(n: PNode, context: PSym): PNode =
## XXX: This should be pretty much guaranteed to be true
# by the type traits procs' signatures, but until the
# code is more mature it doesn't hurt to be extra safe
internalAssert n.sons.len >= 2 and n.sons[1].kind == nkSym and
n.sons[1].sym.typ.kind == tyTypeDesc
internalAssert n.sons.len >= 2 and n.sons[1].kind == nkSym
let typ = n.sons[1].sym.typ.skipTypes({tyTypeDesc})
case n.sons[0].sym.name.s.normalize