-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
MissingWhenCase false negative with nulls #3189
Comments
Closed due to the arguments made in the referenced PR. |
Should we create a tag "require smart cast" or something similar to track this issues? I mean, even if we close it to find them if we eventually implement it. Or if we want ro evaluate if it's worth it to implement it. |
An available smart cast detection alone won't solve the problem here. You'll need more sophisticated analysis than that. |
🤔 why not? |
I didn't know that we already have dataflow analysis as part of the Lines 66 to 78 in b1269b5
|
By the way, this has nothing to do with smart casts per se. The enabler here is data flow analysis as part of the Kotlin compiler. With the help of data flow analysis we can detect whether null checks or the necessary casts have been made before the |
Expected Behavior
MissingWhenCase
should check for null case if the enum or sealed can benull
Observed Behavior
It doesn't check that.
Steps to Reproduce
Your Environment
master
(1.14.2
)The text was updated successfully, but these errors were encountered: