The analyzer has detected a case where the variable may not be checked in the next if statement after an assignment or initialization.
The example:
let ret = foo(....)
if (ret != -1) { .... }
....
let ret2 = bar(....)
if (ret != -1) { .... } // <=
Often, this may happen due to code copy-pasting, when the variable name is not modified. In this example, ret should be replaced with ret2.
let ret2 = bar(....)
if (ret2 != -1) { .... }
This diagnostic rule is classified as:
Was this page helpful?