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
Binding scalars to generics #3769
Comments
I'm kind of undecided if the K in case of a literal value like |
In TypeScript, literals in code are generalized: Since we're dealing with types here, I'd say they should not be generalized. Don't know if this helps though. Or if that's even what you meant. |
psalm has support for it. Would be nice if both tools interpreted this in the same way. |
Implemented: phpstan/phpstan-src@ac7b49e |
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. |
It would be great if generics supported binding scalars. Here's a use case:
Currently, this gives me a
See https://phpstan.org/r/f80b7892-415f-4c38-a63b-37b885d1b6ae
I have read somewhere that this is being considered, but I couldn't find an issue for it and I wanted to provide a use case.
The text was updated successfully, but these errors were encountered: