Turn the warning for uninitialized (result) variables into errors

This commit is contained in:
Zahary Karadjov 2020-03-29 02:06:39 +02:00 • committed by Andreas Rumpf
commit 1b570f2b18
7 changed files with 103 additions and 17 deletions

View file

@ -1396,6 +1396,9 @@ proc copyType*(t: PType, owner: PSym, keepId: bool): PType =
proc exactReplica*(t: PType): PType = copyType(t, t.owner, true)
template requiresInit*(t: PType): bool =
t.flags * {tfRequiresInit, tfHasRequiresInit, tfNotNil} != {}
proc copySym*(s: PSym): PSym =
result = newSym(s.kind, s.name, s.owner, s.info, s.options)
#result.ast = nil # BUGFIX; was: s.ast which made problems