Bug report
PHPStan fails to correctly infer callback parameter types when using @phpstan-self-out with methods that accept callbacks returning generators (at very least). The issue manifests when chaining such methods, causing PHPStan to lose track of generic types.
Code snippet that reproduces the problem
https://phpstan.org/r/9bc8431d-be6a-4dfb-9b1a-c8665c724f09
Expected output
I expect no errors in both examples. Currently, the example that does not use method chaining, has no errors, but that which does - ends with lost type information. At the same time @phpstan-self-out and @return declare identical types.
Did PHPStan help you today? Did it make you happy in any way?
It is really surprising how well PHPStan works. Thank you!
Bug report
PHPStan fails to correctly infer callback parameter types when using
@phpstan-self-outwith methods that accept callbacks returning generators (at very least). The issue manifests when chaining such methods, causing PHPStan to lose track of generic types.Code snippet that reproduces the problem
https://phpstan.org/r/9bc8431d-be6a-4dfb-9b1a-c8665c724f09
Expected output
I expect no errors in both examples. Currently, the example that does not use method chaining, has no errors, but that which does - ends with lost type information. At the same time
@phpstan-self-outand@returndeclare identical types.Did PHPStan help you today? Did it make you happy in any way?
It is really surprising how well PHPStan works. Thank you!