@param Generator<mixed>
doesn't accept anything but a generator that actually yield mixed
type
#6464
Labels
Milestone
Bug report
Like with an
iterable<mixed>
I expect a parameter typedGenerator<mixed>
to accept a generator that has been inferred to be a\Generator<anyType>
.But in level 9, phpstan complains that the given type do not match the expected one, except if the inferred yielded type is actually
mixed
.Code snippet that reproduces the problem
https://phpstan.org/r/ce1f6000-702b-4562-b81b-44dc3f08444a
Expected output
No error.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me every work day 😉 It's great. Thanks
The text was updated successfully, but these errors were encountered: