diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/destructuringDeclarationUsages.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/destructuringDeclarationUsages.kt index c622830e45f..d3bf7cb430a 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/destructuringDeclarationUsages.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/destructuringDeclarationUsages.kt @@ -390,6 +390,13 @@ private class Processor( } } + is KtSuperTypeListEntry -> { + if (typeRef == typeRefParent.typeReference) { + // usage in super type list - just ignore, inheritors are processed above + return true + } + } + is KtIsExpression -> { val scopeOfPossibleSmartCast = typeRefParent.getParentOfType(true) scopeOfPossibleSmartCast?.let { usePlainSearch(it) } diff --git a/idea/testData/findUsages/kotlin/conventions/components/dataClass.0.kt b/idea/testData/findUsages/kotlin/conventions/components/dataClass.0.kt index 314e81f6282..9acc50f6dad 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/dataClass.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/components/dataClass.0.kt @@ -10,6 +10,8 @@ data class A(val n: Int, val s: String, val o: Any) { } } +abstract class X : Comparable + fun A.ext1() { val (x, y) = getThis() } diff --git a/idea/testData/findUsages/kotlin/conventions/components/dataClass.results.txt b/idea/testData/findUsages/kotlin/conventions/components/dataClass.results.txt index 169256b7e58..3644499092e 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/dataClass.results.txt +++ b/idea/testData/findUsages/kotlin/conventions/components/dataClass.results.txt @@ -1,5 +1,5 @@ -[dataClass.0.kt] Value read 14 val (x, y) = getThis() -[dataClass.0.kt] Value read 22 val (x, y) = get(0) +[dataClass.0.kt] Value read 16 val (x, y) = getThis() +[dataClass.0.kt] Value read 24 val (x, y) = get(0) [dataClass.1.kt] Function call 6 a.component1() [dataClass.1.kt] Value read 10 val (x2, y2, z2) = g() [dataClass.1.kt] Value read 11 val (x3, y3, z3) = h() diff --git a/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.0.kt b/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.0.kt index 6d9626df86c..9e092d7e4b0 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.0.kt @@ -1,15 +1,14 @@ // PSI_ELEMENT: org.jetbrains.kotlin.psi.KtFunction // OPTIONS: usages -open class X +interface X -class Y : X() +class Y : X operator fun X.component1(): Int = 0 operator fun X.component2(): Int = 1 - -fun f() = X() +fun f() = Y() fun test() { val (x, y) = f() diff --git a/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.results.txt b/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.results.txt index 77f0bdc7dcf..9975558d098 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.results.txt +++ b/idea/testData/findUsages/kotlin/conventions/components/extensionComponentFun.results.txt @@ -1,2 +1,2 @@ -Value read 15 val (x, y) = f() -Value read 19 val (a, b) = this \ No newline at end of file +Value read 14 val (x, y) = f() +Value read 18 val (a, b) = this \ No newline at end of file