[FIR] Fix resolution of objects in presence of low-priority candidates

For CallKind.VariableAccess, the condition when to *skip* resolution of
objects was previously collector.isSuccess. This wasn't strict enough
because collector.isSuccess could be true when the best found candidate
has an applicability like RESOLVED_WITH_LOW_PRIORITY (e.g. from dynamic
scope or annotated with @LowPriorityInOverloadResolution). In these
cases, we do want to resolve objects. To fix this, the condition is
changed to collector.shouldStopResolve which is stricter.

#KT-57960 Fixed
This commit is contained in:
Kirill Rakhman
2023-04-17 18:31:50 +02:00
committed by Space Team
parent bc7aea1426
commit 8b47a4fa48
14 changed files with 228 additions and 2 deletions
@@ -290,6 +290,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/inference.kt");
}
@Test
@TestMetadata("kt57960.kt")
public void testKt57960() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/kt57960.kt");
}
@Test
@TestMetadata("membersOfAny.kt")
public void testMembersOfAny() throws Exception {
@@ -314,6 +320,12 @@ public class FirPsiJsOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiJ
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/nullable.kt");
}
@Test
@TestMetadata("objectAccessInLambdaWithDynamicReceiver.kt")
public void testObjectAccessInLambdaWithDynamicReceiver() throws Exception {
runTest("compiler/testData/diagnostics/testsWithJsStdLib/dynamicTypes/objectAccessInLambdaWithDynamicReceiver.kt");
}
@Test
@TestMetadata("overloading.kt")
public void testOverloading() throws Exception {