-
Notifications
You must be signed in to change notification settings - Fork 359
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
False positive PhanImpossibleCondition in switch #3222
Labels
dead code detection
Affects --dead-code-detection
enhancement
This improves the quality of Phan's analysis of a codebase
Comments
sorry, I don't understand why the code is formated this way in this editor; attaching php files is not supported either. Hope you can read it anyway. |
btw you can combine it with $y=0;
switch($x){
case 1:
$y=2;
//no break;
case 2:
echo ($y?:'-'); // emits PhanImpossibleCondition Impossible attempt to cast $y of type 0 to truthy
} |
The PhanImpossibleCondition is a new issue, the other issue is a duplicate of #1811 For future reference, use triple backticks, like so: ```php |
TysonAndre
changed the title
PhanUnusedVariable emitted if switch/case does not break
False positive PhanImpossibleCondition in switch
Sep 6, 2019
TysonAndre
added
dead code detection
Affects --dead-code-detection
enhancement
This improves the quality of Phan's analysis of a codebase
labels
Sep 6, 2019
thx, used the button from this editor.... |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dead code detection
Affects --dead-code-detection
enhancement
This improves the quality of Phan's analysis of a codebase
Unused variable is emitted if a variable is assigned a value inside a switch/case without break:
The text was updated successfully, but these errors were encountered: