KT-7929 related: incorrect KtDestructuringDeclarationEntry is not resolved to descriptor, fixes EA-76715

This commit is contained in:
Mikhail Glukhikh
2016-10-21 15:50:22 +03:00
parent 1c8a2bb4cc
commit 6b9252a5d3
3 changed files with 15 additions and 1 deletions
@@ -217,7 +217,9 @@ class ResolveElementCache(
contextElements
.map { it.getNonStrictParentOfType<KtDeclaration>() }
.filterNotNull()
.filterTo(declarationsToResolve) { it !is KtAnonymousInitializer && it !is KtDestructuringDeclaration }
.filterTo(declarationsToResolve) {
it !is KtAnonymousInitializer && it !is KtDestructuringDeclaration && it !is KtDestructuringDeclarationEntry
}
addResolveSessionBindingContext = true
}
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
// See KT-7929, EA-76715
class C {
val (<caret>x, y) = Pair(1, 2)
}
@@ -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");