Open tscni opened 1 year ago
I found these snippets:
Likely the same root cause, with this cause: https://psalm.dev/r/fa5d15a8ee
PossiblyNullReference
false positive is triggered (impossible because $a
cannot be truthy if $b === null
I found these snippets:
Without null-safe operator on first check: https://psalm.dev/r/b2ef61192d With null-safe operator on first check: https://psalm.dev/r/ff20aa26bc (this is the issue)
I suppose the one without the null-safe operator failing is intended because
$something->isA()
means that$something
cannot be nullable beyond it, as it'd have errored otherwise. Maybe this hints at the solution?The issue disappears when the result of the method is compared against a non-true value: https://psalm.dev/r/2c16762b74