-
-
Notifications
You must be signed in to change notification settings - Fork 946
Closed
Description
Bug report
The generic parameter is being used as the return type of the closure, rather than being resolved further
Code snippet that reproduces the problem
https://phpstan.org/r/888dd924-0572-4f7d-b143-7a6aea1a9924
Expected output
Shouldn't report any error. TRet should be resolved to int rather than T.
Did PHPStan help you today? Did it make you happy in any way?
Added the non-negative-int type to a function parameter that was assuming as such and immediately picked up a couple of edge-case bugs :)
Reactions are currently unavailable