-
Notifications
You must be signed in to change notification settings - Fork 548
Keep non nullability if right expr is NeverType
#1063
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
Conversation
|
ready for review! |
NeverType
ondrejmirtes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it only for explicit NeverType. Otherwise it's perfect 😊
|
@rajyan just wanted to say that I love the "small" fixes you're doing here and there. I was mostly too scared of NodeScopeResolver yet :) |
|
@ondrejmirtes @herndlm @ondrejmirtes |
|
Thank you! |
|
@herndlm This is usually what I have in mind when I tag an issue with "Easy fixes" milestone, it shouldn't be more than a few lines of code (but of course I can be wrong). |
|
@rajyan Can you please add regression tests for this issue and make sure it fails when your fix is reverted? Thank you. phpstan/phpstan#4747 Also, this example https://phpstan.org/r/9879d278-5c2d-42ca-81e8-06e87bef529c from phpstan/phpstan#4885 should work but doesn't. Can you please look into it? Thanks. |
|
@ondrejmirtes |
small as in, a few lines of code, but timing-wise it might take hours to think and get into it (at least for outsiders) ;) |
fixes phpstan/phpstan#5351
I haven't found yet why the second test case passes without this fix.The test wasn't what I intended. fixed