-
Notifications
You must be signed in to change notification settings - Fork 27
Call to static method Webmozart\Assert\Assert::allCount() with array and 2 will always evaluate to true. #130
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
Comments
I'm on it, git bisect is telling me that
To me it looks like it never worked correctly, at least since I'll continue debugging the resulting types in the meantime, I assume there is something lost on the way.. |
OK, I know already what the problem is. The expression is good and PHPStan can figure out types for it But via I can think of 2 adaptions right now:
I don't really like both solutions, the second is simple, but feels wrong and leads to other things not being reported I guess. The first one feels more correct but might be complicated, I have to check :) |
I'm using phpstan-strict-rules, so always-false and always-true conditions are reported ; and I had no errors before (with 1.0.9). Weirdly.
👍 |
Oh boy, this is complicated..
maybe I should wait for the |
My idea for
With this logic implemented, some issues should go away. What needs to be solved additionally to have more bugs fixed, is to realize what's happening with current false positives related to ImpossibleCheckTypeHelper. For example - this PR phpstan/phpstan-src#1068 or PRs for But when ImpossibleCheckTypeHelper sees that a
I believe this would still narrow down the type of Anyway, I already sinked too much time into TypeSpecifier and ImpossibleCheckTypeHelper over the last month, and I want to take care of other things too, so feel free to try this idea yourself :) |
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. |
I bumped from 1.0.9 to 1.1.2 ;
I assume it's related to 56d7b27 @herndlm
The text was updated successfully, but these errors were encountered: