-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
phpstan/phpstan-src
#3053Labels
Milestone
Description
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
Reactions are currently unavailable