-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#4384Labels
Description
Bug report
For the given code, phpstan reports correctly that SplFixedArray can be removed from return type (method a).
But when removing it, phpstan complains about missing value type (method b).
For method a phpstan does not complain about missing value type.
I think phpstan should keep the array value type info for the narrowed return type without having to note it again via phpdoc.
Code snippet that reproduces the problem
https://phpstan.org/r/d357662a-cd0d-49e9-b03f-3bb23fd9ebd7
Expected output
No error for method b.
Did PHPStan help you today? Did it make you happy in any way?
No response