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
Types specified in array-shapes are not properly enforced #6286
Comments
After some experimenting, this seems to be an issue with the array shapes rather than the type aliases: |
This is a duplicate of: #5804 I have a local branch where the error is reported but it needs a bit more polish. |
I note that there has been progress on this. However, there are still some cases where the error is not reported properly. Please see line 25 which does NOT cause an error, but which I believe should: |
@phinor Please open a new issue about it, thanks. |
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
PHPstan version: 1.3.0
When using a local type alias, phpstan does not enforce types in arrays.
Code snippet that reproduces the problem
https://phpstan.org/r/00c4b560-d9ba-4d5d-a7ff-15e9596e0565
Expected output
Line 16 should report an error since a string literal is being assigned and not an
int
as required by the local type alias.Did PHPStan help you today? Did it make you happy in any way?
Yes - very grateful for this tool!
The text was updated successfully, but these errors were encountered: