-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1106Description
Bug report
When passing an intersection type A&B into a function that takes and returns a T of one of those (e.g. T of A), the intersection type info is lost and the return of that function can no longer be used as a B. I'm not sure whether this should work or not, but figured I would post it for discussion.
Code snippet that reproduces the problem
https://phpstan.org/r/716007c4-7adf-437a-9f92-06f163de5ba7
Expected output
Did PHPStan help you today? Did it make you happy in any way?
PHPStan is such a game changer that I am thoroughly redesigning my project around using it.