You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a couple of spurious errors reported by psalm related to a boolean that psalm seems to assume being always false. I reduced the code to the following which still reproduces the error messages: https://psalm.dev/r/acfa45bb65
In the real code, the function is called with both true and false values for the parameter. I can add calls with true / false parameter to the sample snippet and the errors will also still be reported. This looks like a bug to me, but if it's a misunderstanding on my end I would also appreciate info to understand the cause for these errors to be able to fix them.
The text was updated successfully, but these errors were encountered:
<?phpfunctiontestFunc(bool$pst): void
{
do {
$status = rand();
if (($pst === false) && ($status == 412)) {
}
} while (($pst === false) && ($status == 412));
if ($pst === true) {
}
}
Psalm output (using commit bcd7478):
ERROR: RedundantCondition - 7:21 - Found a redundant condition when evaluating $pst and trying to reconcile type 'false' to false
ERROR: TypeDoesNotContainType - 11:13 - false does not contain true
Hello,
I have a couple of spurious errors reported by psalm related to a boolean that psalm seems to assume being always false. I reduced the code to the following which still reproduces the error messages: https://psalm.dev/r/acfa45bb65
In the real code, the function is called with both true and false values for the parameter. I can add calls with true / false parameter to the sample snippet and the errors will also still be reported. This looks like a bug to me, but if it's a misunderstanding on my end I would also appreciate info to understand the cause for these errors to be able to fix them.
The text was updated successfully, but these errors were encountered: