bugfix: new(TTable[string, int]) compiles
This commit is contained in:
parent
e7581e7b9b
commit
5b5b02cb15
1 changed files with 9 additions and 4 deletions
|
|
@ -222,10 +222,11 @@ proc semTypeIdent(c: PContext, n: PNode): PSym =
|
||||||
let bound = result.typ.sons[0].sym
|
let bound = result.typ.sons[0].sym
|
||||||
if bound != nil:
|
if bound != nil:
|
||||||
return bound
|
return bound
|
||||||
else:
|
return result
|
||||||
return result.typ.sym
|
if result.typ.sym == nil:
|
||||||
else:
|
LocalError(n.info, errTypeExpected)
|
||||||
return result.typ.sym
|
return errorSym(c, n)
|
||||||
|
return result.typ.sym
|
||||||
if result.kind != skType:
|
if result.kind != skType:
|
||||||
# this implements the wanted ``var v: V, x: V`` feature ...
|
# this implements the wanted ``var v: V, x: V`` feature ...
|
||||||
var ov: TOverloadIter
|
var ov: TOverloadIter
|
||||||
|
|
@ -876,6 +877,10 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
|
||||||
if s.typ == nil:
|
if s.typ == nil:
|
||||||
if s.kind != skError: LocalError(n.info, errTypeExpected)
|
if s.kind != skError: LocalError(n.info, errTypeExpected)
|
||||||
result = newOrPrevType(tyError, prev, c)
|
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:
|
elif prev == nil:
|
||||||
result = s.typ
|
result = s.typ
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue