diff options
author | Zahary Karadjov <zahary@gmail.com> | 2013-12-29 00:00:37 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2013-12-29 00:00:37 +0200 |
commit | 66a255652572b48440b68878e99d7f5290e384b3 (patch) | |
tree | 3349b1791218a3416209569848244245e087009d /compiler/semexprs.nim | |
parent | eb1d23c0c745c64225e8db22f62d8ebf596f4448 (diff) | |
download | Nim-66a255652572b48440b68878e99d7f5290e384b3.tar.gz |
make more tests green
Diffstat (limited to 'compiler/semexprs.nim')
-rw-r--r-- | compiler/semexprs.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index fde09400d..6294fb3c9 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -301,10 +301,10 @@ proc semOf(c: PContext, n: PNode): PNode = proc isOpImpl(c: PContext, n: PNode): PNode = InternalAssert n.sonsLen == 3 and - n[1].kind == nkSym and n[1].sym.kind == skType and + n[1].typ != nil and n[1].typ.kind == tyTypeDesc and n[2].kind in {nkStrLit..nkTripleStrLit, nkType} - let t1 = n[1].sym.typ.skipTypes({tyTypeDesc}) + let t1 = n[1].typ.skipTypes({tyTypeDesc}) if n[2].kind in {nkStrLit..nkTripleStrLit}: case n[2].strVal.normalize @@ -1942,7 +1942,9 @@ proc semExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode = # type parameters: partial generic specialization n.sons[0] = semSymGenericInstantiation(c, n.sons[0], s) result = explicitGenericInstantiation(c, n, s) - else: + elif s != nil and s.kind in {skType}: + result = symNodeFromType(c, semTypeNode(c, n, nil), n.info) + else: result = semArrayAccess(c, n, flags) of nkCurlyExpr: result = semExpr(c, buildOverloadedSubscripts(n, getIdent"{}"), flags) |