First steps, the compiler can boot with enforced requiresInit

This commit is contained in:
Zahary Karadjov 2020-03-27 15:47:49 +02:00 • committed by Andreas Rumpf
commit a8b6222c86
7 changed files with 26 additions and 29 deletions

View file

@ -336,7 +336,7 @@ proc semIdentDef(c: PContext, n: PNode, kind: TSymKind): PSym =
proc checkNilable(c: PContext; v: PSym) =
if {sfGlobal, sfImportc} * v.flags == {sfGlobal} and
{tfNotNil, tfNeedsInit} * v.typ.flags != {}:
{tfNotNil, tfRequiresInit} * v.typ.flags != {}:
if v.astdef.isNil:
message(c.config, v.info, warnProveInit, v.name.s)
elif tfNotNil in v.typ.flags and not v.astdef.typ.isNil and tfNotNil notin v.astdef.typ.flags: