Bug report
I don't really understand what is going on here. The return type of doFoo is correctly inferred from the arrow function. But still there is a unresolvable type error. Which seems wrong cause it's clearly resolved 😄
Also, it only happens with bleeding edge. Which made me think it might be related to sealed arrays, but have no idea how it can be connected.
Code snippet that reproduces the problem
https://phpstan.org/r/67d9b0bf-d373-4b95-926b-df6c11ec1f6e
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
Always! Especially with AI writing code now, it's so satisfying to make new PHPStan rules every time we notice a mistake the agent made.
Bug report
I don't really understand what is going on here. The return type of
doFoois correctly inferred from the arrow function. But still there is a unresolvable type error. Which seems wrong cause it's clearly resolved 😄Also, it only happens with bleeding edge. Which made me think it might be related to sealed arrays, but have no idea how it can be connected.
Code snippet that reproduces the problem
https://phpstan.org/r/67d9b0bf-d373-4b95-926b-df6c11ec1f6e
Expected output
No errors
Did PHPStan help you today? Did it make you happy in any way?
Always! Especially with AI writing code now, it's so satisfying to make new PHPStan rules every time we notice a mistake the agent made.