No more attempts to resolve KtDestructuringDeclaration to descriptor #KT-7929 Fixed

Also #KT-8442 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-10-21 15:01:31 +03:00
parent 7d89869c02
commit 1c8a2bb4cc
3 changed files with 13 additions and 1 deletions

View File

@@ -217,7 +217,7 @@ class ResolveElementCache(
contextElements
.map { it.getNonStrictParentOfType<KtDeclaration>() }
.filterNotNull()
.filterTo(declarationsToResolve) { it !is KtAnonymousInitializer }
.filterTo(declarationsToResolve) { it !is KtAnonymousInitializer && it !is KtDestructuringDeclaration }
addResolveSessionBindingContext = true
}
}

View File

@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
// See KT-7929: exception
class C {
<caret>val (v1, v2) = Pair(1, 2)
}

View File

@@ -2768,6 +2768,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
doTest(fileName);
}
@TestMetadata("destructuringPropertyException.kt")
public void testDestructuringPropertyException() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/destructuringPropertyException.kt");
doTest(fileName);
}
@TestMetadata("primaryConstructor.kt")
public void testPrimaryConstructor() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/primaryConstructor.kt");