bugfix: object constructor doesn't allow 'distinct' types
This commit is contained in:
parent
ad74332a92
commit
d8d93218fa
1 changed files with 2 additions and 2 deletions
|
|
@ -1709,8 +1709,8 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||||
result = n
|
result = n
|
||||||
result.typ = t
|
result.typ = t
|
||||||
result.kind = nkObjConstr
|
result.kind = nkObjConstr
|
||||||
t = skipTypes(t, abstractInst)
|
t = skipTypes(t, {tyGenericInst})
|
||||||
if t.kind == tyRef: t = skipTypes(t.sons[0], abstractInst)
|
if t.kind == tyRef: t = skipTypes(t.sons[0], {tyGenericInst})
|
||||||
if t.kind != tyObject:
|
if t.kind != tyObject:
|
||||||
localError(n.info, errGenerated, "object constructor needs an object type")
|
localError(n.info, errGenerated, "object constructor needs an object type")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue