Details
-
Improvement
-
Status: Closed
-
Normal
-
Resolution: Done
-
None
-
None
-
1
-
Language 2015-03-04, Language 2015-03-18
Description
The new valiidator emits errors for non productive expressions. This because they are meaningless (produce values that are thrown away and does not cause side effects) and probably mask other problems.
While this is good in general - there are cases when developing code that makes this annoying.
Consider this:
if true {
|
# commented out
|
}
|
$a = 10
|
Here, the entire if-expression is non productive (and it can be removed), It seems harsh to report this as an error (at all times).
I am reluctant to always turning this into a warning, but can imagine a mode where non-productive expressions are either ignored, or that they produce a warning. We could add a setting for 'non_productive_expression' and accept the values: ignore, warning, error - where error is the default.
Attachments
Issue Links
- links to