Enable the requiresInit checks only for objects
This commit is contained in:
parent
8ae48292ff
commit
54f06427c8
2 changed files with 2 additions and 2 deletions
|
|
@ -2268,7 +2268,7 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
|
||||||
result = semDirectOp(c, n, flags)
|
result = semDirectOp(c, n, flags)
|
||||||
c.config.internalAssert result[1].typ.kind == tyTypeDesc
|
c.config.internalAssert result[1].typ.kind == tyTypeDesc
|
||||||
let typ = result[1].typ.base
|
let typ = result[1].typ.base
|
||||||
if typ.kind in {tyObject, tyTuple}:
|
if typ.kind == tyObject:
|
||||||
checkDefaultConstruction(c, typ, n.info)
|
checkDefaultConstruction(c, typ, n.info)
|
||||||
else:
|
else:
|
||||||
result = semDirectOp(c, n, flags)
|
result = semDirectOp(c, n, flags)
|
||||||
|
|
|
||||||
|
|
@ -615,7 +615,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
|
||||||
else: v.typ = tup
|
else: v.typ = tup
|
||||||
b[j] = newSymNode(v)
|
b[j] = newSymNode(v)
|
||||||
if def.kind == nkEmpty:
|
if def.kind == nkEmpty:
|
||||||
if v.typ.kind in {tyObject, tyTuple}:
|
if v.typ.kind == tyObject:
|
||||||
checkDefaultConstruction(c, v.typ, v.info)
|
checkDefaultConstruction(c, v.typ, v.info)
|
||||||
else:
|
else:
|
||||||
checkNilable(c, v)
|
checkNilable(c, v)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue