-
-
Notifications
You must be signed in to change notification settings - Fork 884
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
phpstan 1.8.5 reports weird failures about the returned array type when returning a list of shapes #8004
Comments
This bug report is missing a link to reproduction at phpstan.org/try. It will most likely be closed after manual review. |
Could you add the local error message since the code snippet breaks phpstan.org ? I would say it's similar to #7963, too complicated array are now simplified when the type is computed by phpstan (which explain why there is no error with the |
|
Definitely related then. The array shape is "just" simplified when inferred by PHPStan. |
/cc @rvanvelzen This one is definitely interesting, I thought that your Arnaud-inspired array collapse improvements would fix this but it doesn't. But I don't understand the behaviour. When I analyse this locally, the type of
When I increase the limit in
Which is quite nice and small. And I don't understand why I need to increase the optimization limit when the resulting array type is actually this small!? When I revert to the original optimization limit and dump the types that are optimized, they look like this: click for more
What I don't understand:
|
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
Code snippet that reproduces the problem
This code snippet currently breaks the REPL on phpstan.org (the API returns a 502 bad gateway error)
Expected output
no error (as was the case in 1.8.1).
Note that adding this phpdoc removes the reported error:
Did PHPStan help you today? Did it make you happy in any way?
The text was updated successfully, but these errors were encountered: