New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property (iterable<T>|null) does not accept iterable<T> #6230
Comments
Smaller snippet: https://phpstan.org/r/eafd4309-56cf-4698-b30f-d4cf578f2ad9 Problem disappears when specifying the iterable key to a non-mixed type: https://phpstan.org/r/f2035689-6518-4053-a57a-fe58256d25f9 Seems related to #6418 Probable cause:
|
@sanmai After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-19: Property Example<T>::$input (iterable<T>|null) does not accept iterable<T>.
-25: Method Example::get() should return iterable<T>|null but returns iterable<T>|null.
+No errors |
@arnaud-lb After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-9: Function test() should return iterable|null but returns iterable|null.
+No errors |
Fixed: phpstan/phpstan-src@9f12f0f |
Closes phpstan/phpstan#6464 Closes phpstan/phpstan#6423 Closes phpstan/phpstan#6418 Closes phpstan/phpstan#6230 Closes phpstan/phpstan#5860
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
I'm looking at the following errors which read like nonsense:
Example<T>::$input
(iterable<T>|null
) does not acceptiterable<T>
.iterable<T>|null
but returnsiterable<T>|null
.Code snippet that reproduces the problem
https://phpstan.org/r/91bc6557-e814-4b06-bc9d-eb9d9ce17342
Expected output
No errors.
This new issue appeared when upgrading from 0.12.99 to 1.0.2.
The text was updated successfully, but these errors were encountered: