UnusedImports rule: fix false negative when same name identifiers are imported and used - #3033
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3033 +/- ##
============================================
- Coverage 79.16% 79.16% -0.01%
Complexity 2543 2543
============================================
Files 434 434
Lines 7728 7737 +9
Branches 1466 1471 +5
============================================
+ Hits 6118 6125 +7
Misses 824 824
- Partials 786 788 +2
Continue to review full report at Codecov.
|
t-kameyama
force-pushed
the
issue_3020
branch
3 times, most recently
from
August 29, 2020 04:37
6f99f9c to
1df460a
Compare
… imported and used
schalkms
approved these changes
Aug 29, 2020
arturbosch
approved these changes
Aug 29, 2020
cortinico
reviewed
Aug 30, 2020
| if (aliasName in (namedReferencesInKDoc + namedReferencesAsString)) return false | ||
| val identifier = identifier() | ||
| if (identifier in namedReferencesInKDoc) return false | ||
| return if (bindingContext == BindingContext.EMPTY) { |
Member
There was a problem hiding this comment.
This is yet another rule where we're adding a mixed behavior based on Type Resolution: #2994
Ideally we should either:
- Restrict this rule to work on TR only or
- Remove the
@requiresTypeResolutionin the documentation as it's an overstatement - Revert this change and find a different solution that doesn't require TR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3020