summary refs log tree commit diff stats
path: root/compiler/semobjconstr.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2020-03-29 02:06:39 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-04-01 19:38:44 +0200
commit1b570f2b187fea9571476a1e2e768d2d4c2f7aa5 (patch)
tree3c4dcb1a6d4483dc6af28330b4ae41c49cf0387b /compiler/semobjconstr.nim
parente0bb78553ad34282ff198c4f1121b14b18030dc2 (diff)
downloadNim-1b570f2b187fea9571476a1e2e768d2d4c2f7aa5.tar.gz
Turn the warning for uninitialized (result) variables into errors
Diffstat (limited to 'compiler/semobjconstr.nim')
-rw-r--r--compiler/semobjconstr.nim5
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: