[VarCouldBeVal] Override vars will not be flagged if bindingContext is not set#4477
Conversation
cortinico
left a comment
There was a problem hiding this comment.
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) returnshould 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