Plug another hole: default(T) forbidden for objects requiring initialization
This commit is contained in:
parent
05a0ec4adb
commit
8ae48292ff
5 changed files with 31 additions and 19 deletions
|
|
@ -616,7 +616,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
|
|||
b[j] = newSymNode(v)
|
||||
if def.kind == nkEmpty:
|
||||
if v.typ.kind in {tyObject, tyTuple}:
|
||||
discard semConstructType(c, newNodeI(nkObjConstr, v.info), v.typ, {})
|
||||
checkDefaultConstruction(c, v.typ, v.info)
|
||||
else:
|
||||
checkNilable(c, v)
|
||||
if sfCompileTime in v.flags:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue