Show field not initialized warning only when notnil used (#10155)
This commit is contained in:
parent
9faad7591e
commit
6ed9676af5
1 changed files with 1 additions and 1 deletions
|
|
@ -141,7 +141,7 @@ proc semEnum(c: PContext, n: PNode, prev: PType): PType =
|
||||||
if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil):
|
if isPure and (let conflict = strTableInclReportConflict(symbols, e); conflict != nil):
|
||||||
wrongRedefinition(c, e.info, e.name.s, conflict.info)
|
wrongRedefinition(c, e.info, e.name.s, conflict.info)
|
||||||
inc(counter)
|
inc(counter)
|
||||||
if not hasNull: incl(result.flags, tfNeedsInit)
|
if tfNotNil in e.typ.flags and not hasNull: incl(result.flags, tfNeedsInit)
|
||||||
|
|
||||||
proc semSet(c: PContext, n: PNode, prev: PType): PType =
|
proc semSet(c: PContext, n: PNode, prev: PType): PType =
|
||||||
result = newOrPrevType(tySet, prev, c)
|
result = newOrPrevType(tySet, prev, c)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue