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
Generics does not respect type but fallback to basic types #6699
Comments
Related: #6505 |
@bastien-phi After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-22: Dumped type: string
+22: Dumped type: class-string<Exception> Full report
|
Fixed: phpstan/phpstan-src@1b117f7 |
Thanks @ondrejmirtes and @arnaud-lb ! |
ondrejmirtes
added a commit
to phpstan/phpstan-src
that referenced
this issue
Feb 28, 2022
Closes phpstan/phpstan#5893 Closes phpstan/phpstan#6070 Closes phpstan/phpstan#5869 Closes phpstan/phpstan#6212 Closes phpstan/phpstan#6262 Closes phpstan/phpstan#6266 Closes phpstan/phpstan#6023 Closes phpstan/phpstan#6108 Closes phpstan/phpstan#6020 Closes phpstan/phpstan#1746 Closes phpstan/phpstan#1516 Closes phpstan/phpstan#6174 Closes phpstan/phpstan#6112 Closes phpstan/phpstan#5749 Closes phpstan/phpstan#5969 Closes phpstan/phpstan#5295 Closes phpstan/phpstan#5675 Closes phpstan/phpstan#5369 Closes phpstan/phpstan#6699 Closes phpstan/phpstan#6505
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug report
Not sure if it was already reported but it looks like generics fallback to basic type and does not keep defined type.
Code snippet that reproduces the problem
https://phpstan.org/r/94faaba1-0ed2-4d54-8ff0-130a0bf2fb03
Expected output
We expect the
value
to be of typeclass-string<Exception>
.Did PHPStan help you today? Did it make you happy in any way?
As always, amazing tool. It makes me more confident on my code. Great job !
The text was updated successfully, but these errors were encountered: