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
It appears that PHPStan doesn't narrow types that are part of a match expression's condition, which leads to false positives when a match expression is used to eliminate certain types from a union.
Bug report
It appears that PHPStan doesn't narrow types that are part of a match expression's condition, which leads to false positives when a match expression is used to eliminate certain types from a union.
Code snippet that reproduces the problem
https://phpstan.org/r/1b12aa5c-1398-4065-a014-80cfe3c45916
Expected output
No errors. We already know that the object cannot be null because we ended up in the
false
match arm.Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: