fixes #6765
This commit is contained in:
parent
338570ecd0
commit
2d726711fa
1 changed files with 7 additions and 3 deletions
|
|
@ -1420,9 +1420,13 @@ proc semTypeNode(c: PContext, n: PNode, prev: PType): PType =
|
||||||
else: result = semGeneric(c, n, s, prev)
|
else: result = semGeneric(c, n, s, prev)
|
||||||
of nkDotExpr:
|
of nkDotExpr:
|
||||||
let typeExpr = semExpr(c, n)
|
let typeExpr = semExpr(c, n)
|
||||||
if typeExpr.typ.kind == tyFromExpr:
|
if typeExpr.typ.isNil:
|
||||||
return typeExpr.typ
|
localError(n.info, "object constructor needs an object type;" &
|
||||||
if typeExpr.typ.kind != tyTypeDesc:
|
" for named arguments use '=' instead of ':'")
|
||||||
|
result = errorType(c)
|
||||||
|
elif typeExpr.typ.kind == tyFromExpr:
|
||||||
|
result = typeExpr.typ
|
||||||
|
elif typeExpr.typ.kind != tyTypeDesc:
|
||||||
localError(n.info, errTypeExpected)
|
localError(n.info, errTypeExpected)
|
||||||
result = errorType(c)
|
result = errorType(c)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue