diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt index 774768c1dd5..2bdac2a60ff 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt @@ -217,7 +217,9 @@ class ResolveElementCache( contextElements .map { it.getNonStrictParentOfType() } .filterNotNull() - .filterTo(declarationsToResolve) { it !is KtAnonymousInitializer && it !is KtDestructuringDeclaration } + .filterTo(declarationsToResolve) { + it !is KtAnonymousInitializer && it !is KtDestructuringDeclaration && it !is KtDestructuringDeclarationEntry + } addResolveSessionBindingContext = true } } diff --git a/idea/testData/intentions/deprecatedCallableAddReplaceWith/ExceptionInPropertyDestructuringEntry.kt b/idea/testData/intentions/deprecatedCallableAddReplaceWith/ExceptionInPropertyDestructuringEntry.kt new file mode 100644 index 00000000000..89f42034045 --- /dev/null +++ b/idea/testData/intentions/deprecatedCallableAddReplaceWith/ExceptionInPropertyDestructuringEntry.kt @@ -0,0 +1,6 @@ +// IS_APPLICABLE: false + +// See KT-7929, EA-76715 +class C { + val (x, y) = Pair(1, 2) +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index 5dbff74ff16..5e876e85576 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -6290,6 +6290,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("ExceptionInPropertyDestructuringEntry.kt") + public void testExceptionInPropertyDestructuringEntry() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/deprecatedCallableAddReplaceWith/ExceptionInPropertyDestructuringEntry.kt"); + doTest(fileName); + } + @TestMetadata("ExpressionBody.kt") public void testExpressionBody() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/deprecatedCallableAddReplaceWith/ExpressionBody.kt");