-
-
Notifications
You must be signed in to change notification settings - Fork 766
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
[VarCouldBeVal] Override vars will not be flagged if bindingContext is not set #4477
[VarCouldBeVal] Override vars will not be flagged if bindingContext is not set #4477
Conversation
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.
I think we should ship this change as it is, but instead add a:
if(bindingContext == BindingContext.EMPTY) return`
statement inside the visitKtFile
method on top of this class. The problem is that this rule is a rule annotated with @RequiresTypeResolution
, but failing to add early return statement is allowing to run this rule without TR.
This is a bit of a bummer as this rule is now a mixed rule (see #2994) which I believe it should have never been (see #3880)
Cortinico is right, I was mistaken here. We should just disable the rule and honor the annotation. Something like adding if (bindingContext == BindingContext.EMPTY) return should do the trick |
Codecov Report
@@ Coverage Diff @@
## main #4477 +/- ##
============================================
- Coverage 84.32% 84.10% -0.23%
- Complexity 3298 3306 +8
============================================
Files 473 473
Lines 10591 10794 +203
Branches 1907 1994 +87
============================================
+ Hits 8931 9078 +147
- Misses 675 688 +13
- Partials 985 1028 +43
Continue to review full report at Codecov.
|
This addresses issue #4474