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)
|
||||
of nkDotExpr:
|
||||
let typeExpr = semExpr(c, n)
|
||||
if typeExpr.typ.kind == tyFromExpr:
|
||||
return typeExpr.typ
|
||||
if typeExpr.typ.kind != tyTypeDesc:
|
||||
if typeExpr.typ.isNil:
|
||||
localError(n.info, "object constructor needs an object type;" &
|
||||
" 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)
|
||||
result = errorType(c)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue