diff options
author | Araq <rumpf_a@web.de> | 2013-04-10 12:49:30 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-04-10 12:49:30 +0200 |
commit | 5b5b02cb151b9cfd87b620867ad196e1f3f65b0d (patch) | |
tree | a487235eec76afd661e8b91b8dfafece4211fa8d | |
parent | e7581e7b9b580ea14b3fab5bba3fe90caa86acb8 (diff) | |
download | Nim-5b5b02cb151b9cfd87b620867ad196e1f3f65b0d.tar.gz |
bugfix: new(TTable[string, int]) compiles
-rw-r--r-- | compiler/semtypes.nim | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 799be1a91..b3a82c413 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -222,10 +222,11 @@ proc semTypeIdent(c: PContext, n: PNode): PSym = let bound = result.typ.sons[0].sym if bound != nil: return bound - else: - return result.typ.sym - else: - return result.typ.sym + return result + if result.typ.sym == nil: + LocalError(n.info, errTypeExpected) + return errorSym(c, n) + return result.typ.sym if result.kind != skType: # this implements the wanted ``var v: V, x: V`` feature ... var ov: TOverloadIter @@ -876,6 +877,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType = if s.typ == nil: if s.kind != skError: LocalError(n.info, errTypeExpected) result = newOrPrevType(tyError, prev, c) + elif s.kind == skParam and s.typ.kind == tyTypeDesc: + assert s.typ.len > 0 + InternalAssert prev == nil + result = s.typ.sons[0] elif prev == nil: result = s.typ else: |