diff options
author | Zahary Karadjov <zahary@gmail.com> | 2020-03-29 02:06:39 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2020-04-01 19:38:44 +0200 |
commit | 1b570f2b187fea9571476a1e2e768d2d4c2f7aa5 (patch) | |
tree | 3c4dcb1a6d4483dc6af28330b4ae41c49cf0387b /compiler/semobjconstr.nim | |
parent | e0bb78553ad34282ff198c4f1121b14b18030dc2 (diff) | |
download | Nim-1b570f2b187fea9571476a1e2e768d2d4c2f7aa5.tar.gz |
Turn the warning for uninitialized (result) variables into errors
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r-- | compiler/semobjconstr.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim index b9931f527..7222433b3 100644 --- a/compiler/semobjconstr.nim +++ b/compiler/semobjconstr.nim @@ -146,8 +146,9 @@ proc fieldsPresentInInitExpr(c: PContext, fieldsRecList, initExpr: PNode): strin proc missingMandatoryFields(c: PContext, fieldsRecList: PNode, constrCtx: ObjConstrContext): string = for r in directFieldsInRecList(fieldsRecList): - if constrCtx.requiresFullInit or sfRequiresInit in r.sym.flags or - {tfNotNil, tfRequiresInit, tfHasRequiresInit} * r.sym.typ.flags != {}: + if constrCtx.requiresFullInit or + sfRequiresInit in r.sym.flags or + r.sym.typ.requiresInit: let assignment = locateFieldInInitExpr(c, r.sym, constrCtx.initExpr) if assignment == nil: if result.len == 0: |