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

@ -2268,7 +2268,7 @@ proc semMagic(c: PContext, n: PNode, s: PSym, flags: TExprFlags): PNode =
result = semDirectOp(c, n, flags)
c.config.internalAssert result[1].typ.kind == tyTypeDesc
let typ = result[1].typ.base
if typ.kind in {tyObject, tyTuple}:
if typ.kind == tyObject:
checkDefaultConstruction(c, typ, n.info)
else:
result = semDirectOp(c, n, flags)