-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support exhaustiveness checks for sealed interfaces implemented by an enum #2
Comments
Hi, at first glance, this might be a limitation on the side of PHPStan's type subtraction logic. I'll try and look into it, see if that's the case and if I can find a way around it |
Or maybe this is something that should be fixed in the phpstan side indeed. I haven't debugged this. |
@jiripudil did you manage to look at this ? |
for reference, replacing the sealed interface with a union |
I opened a phpstan issue about that: phpstan/phpstan#10148 |
In the code snippet above, as
ColorFormat
allows onlyColorFormatEnum
andSpanColorFormat
and I'm checking explicitly all cases of the enum, I would expect the default branch ofwriteColorWithMatch
and the else branch ofwriteColorWithIf
to know that$format
must be aSpanColorFormat
there (and so callinggetOriginal
is OK.The text was updated successfully, but these errors were encountered: