diff options
author | Araq <rumpf_a@web.de> | 2014-01-13 01:22:03 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2014-01-13 01:22:03 +0100 |
commit | 51ee524109cf7e3e86c676bc1676063a01bfd979 (patch) | |
tree | 0f611cc00834f0452a3f8ed1729c7b62f676f237 /compiler/semfold.nim | |
parent | 4045d7829b0ab9c8749aa701515a53c279db9958 (diff) | |
parent | 1280c56f386111b542c8f0effdd3e5cbc5e84622 (diff) | |
download | Nim-51ee524109cf7e3e86c676bc1676063a01bfd979.tar.gz |
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'compiler/semfold.nim')
-rw-r--r-- | compiler/semfold.nim | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/semfold.nim b/compiler/semfold.nim index 731085c3a..1d03e6888 100644 --- a/compiler/semfold.nim +++ b/compiler/semfold.nim @@ -230,6 +230,7 @@ discard """ """ proc evalIs(n, a: PNode): PNode = + # XXX: This should use the standard isOpImpl internalAssert a.kind == nkSym and a.sym.kind == skType internalAssert n.sonsLen == 3 and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} @@ -251,7 +252,7 @@ proc evalIs(n, a: PNode): PNode = else: # XXX semexprs.isOpImpl is slightly different and requires a context. yay. let t2 = n[2].typ - var match = if t2.kind == tyTypeClass: matchTypeClass(t2, t1) + var match = if t2.kind == tyTypeClass: true else: sameType(t1, t2) result = newIntNode(nkIntLit, ord(match)) result.typ = n.typ @@ -612,9 +613,10 @@ proc getConstExpr(m: PSym, n: PNode): PNode = of skType: result = newSymNodeTypeDesc(s, n.info) of skGenericParam: - if s.typ.kind == tyExpr: - result = s.typ.n - result.typ = s.typ.sons[0] + if s.typ.kind == tyStatic: + if s.typ.n != nil: + result = s.typ.n + result.typ = s.typ.sons[0] else: result = newSymNodeTypeDesc(s, n.info) else: discard |