#UI_ENHANCEMENT by exept
authorClaus Gittinger <cg@exept.de>
Sat, 01 Aug 2020 16:57:39 +0200
changeset 4696 cfef9cabebff
parent 4695 20928bf4422c
child 4697 08bda7a25d0b
#UI_ENHANCEMENT by exept class: Parser changed: #warnIfPossiblyUninitializedLocal:
Parser.st
--- a/Parser.st	Fri Jul 31 10:28:33 2020 +0200
+++ b/Parser.st	Sat Aug 01 16:57:39 2020 +0200
@@ -5041,7 +5041,14 @@
           and:[expr parent selector = '='
         ]]) ifTrue:[
             msg := msg,c'\n"=" is comparing - did you mean ":=" for assignment?'
-        ].
+        ] ifFalse:[
+            "/ cg: for now: skip this check here; it has too many false positives
+            "/ TODO: this must be checked when the whole tree is present, and we can look along the
+            "/ node's parent chain for a costruct like 'foo notNil and:[...]'
+            "/ here, the parent is usually nil, due to the recursive nature of the parser.
+            ^ self.
+        ].
+
         self
             warning:(msg  bindWith:expr name)
             doNotShowAgainAction:(self actionToDisableWarning:#warnAboutPossiblyUninitializedLocals)