ExplicitCollectionElementAccessMethod: fix false positive for get operators with type parameters#4803
Merged
Merged
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4803 +/- ##
============================================
- Coverage 84.70% 84.70% -0.01%
Complexity 3426 3426
============================================
Files 491 491
Lines 11253 11258 +5
Branches 2069 2071 +2
============================================
+ Hits 9532 9536 +4
Misses 676 676
- Partials 1045 1046 +1
Continue to review full report at Codecov.
|
…rators with type parameters
cortinico
approved these changes
May 3, 2022
|
|
||
| private fun isIndexableGetter(expression: KtCallExpression): Boolean = | ||
| expression.calleeExpression?.text == "get" && expression.getFunctionDescriptor()?.isOperator == true | ||
| private fun isIndexableGetter(expression: KtCallExpression): Boolean { |
Member
There was a problem hiding this comment.
nit: Maybe change the function name here as IndexableGetter is not really clear. I'm not able to come up with a better name though
BraisGabin
approved these changes
May 3, 2022
schalkms
approved these changes
May 4, 2022
Whathecode
added a commit
to Whathecode/detekt
that referenced
this pull request
Jun 24, 2022
This also provides a less strict and universal implementation for the previous type parameters bugfix: detekt#4803 As commented in the code, it does this by doing a lazy attempt at whether type inference is possible. If needed, this can be extended on later.
BraisGabin
pushed a commit
that referenced
this pull request
Jul 6, 2022
…collections (#4994) * Refactor: clear separation between "can" and "recommended" replace This also provides a less strict and universal implementation for the previous type parameters bugfix: #4803 As commented in the code, it does this by doing a lazy attempt at whether type inference is possible. If needed, this can be extended on later. * Fix: non-sensical index accessor recommendations for java classes Closes #4918 * Refactor: use default Java sources for ExplicitCollectionElementAccess test
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.
Fix for #4791