Skip to content
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

Template type TValue on class Ds\Set is not covariant when using enum #10484

Open
EmilMassey opened this issue Jan 25, 2024 · 1 comment
Open
Labels
Milestone

Comments

@EmilMassey
Copy link

EmilMassey commented Jan 25, 2024

Bug report

When expecting parameter \Ds\Set<SomeEnum> and calling the function with SomeEnum::SomeCase, there's a report that this is not allowed.

It's reported with bleeding edge enabled since 1.10.49.

Code snippet that reproduces the problem

https://phpstan.org/r/d24e92f2-8c7b-40de-a4b6-ecdf4117b177

Expected output

I think it should be valid usage, but maybe my snippet is indeed unsafe?

Did PHPStan help you today? Did it make you happy in any way?

Gave me a sense of security when I did a massive dependencies upgrade

@EmilMassey
Copy link
Author

EmilMassey commented Feb 21, 2024

It seems this is pretty much the same issue as #6433, which is marked as fixed, although the snippet fails with bleeding edge enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants