mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 18:32:11 +00:00
bugfix: object constructor doesn't allow 'distinct' types
This commit is contained in:
@@ -1709,8 +1709,8 @@ proc semObjConstr(c: PContext, n: PNode, flags: TExprFlags): PNode =
|
||||
result = n
|
||||
result.typ = t
|
||||
result.kind = nkObjConstr
|
||||
t = skipTypes(t, abstractInst)
|
||||
if t.kind == tyRef: t = skipTypes(t.sons[0], abstractInst)
|
||||
t = skipTypes(t, {tyGenericInst})
|
||||
if t.kind == tyRef: t = skipTypes(t.sons[0], {tyGenericInst})
|
||||
if t.kind != tyObject:
|
||||
localError(n.info, errGenerated, "object constructor needs an object type")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user