-
Notifications
You must be signed in to change notification settings - Fork 653
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
InvalidCast when working with ::class on generics #8810
Comments
I found these snippets: https://psalm.dev/r/13175e171b
|
Simplified a bit: https://psalm.dev/r/db793e0df3 |
I found these snippets: https://psalm.dev/r/db793e0df3
|
That's really weird, Psalm transforms the TLiteralClassString into a TNamedObject at some point and then complains it can't cast it to string... |
Looking forward to the fix. We have many such issues in our project. |
Yet another example https://psalm.dev/r/80771a0b51 |
I found these snippets: https://psalm.dev/r/80771a0b51
|
Awesome, thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I copy/pasted the relevant parts of my code here: https://psalm.dev/r/13175e171b. When dealing with somewhat complex constrained generics, using
::class
gives me anInvalidCast {NameOfClass} cannot be cast to string
. This is happening on the master branch of Psalm.The text was updated successfully, but these errors were encountered: