Enable the requiresInit checks only for objects

This commit is contained in:
Zahary Karadjov 2020-03-27 21:58:32 +02:00 • committed by Andreas Rumpf
commit 54f06427c8
2 changed files with 2 additions and 2 deletions

View file

@ -615,7 +615,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
else: v.typ = tup
b[j] = newSymNode(v)
if def.kind == nkEmpty:
if v.typ.kind in {tyObject, tyTuple}:
if v.typ.kind == tyObject:
checkDefaultConstruction(c, v.typ, v.info)
else:
checkNilable(c, v)