K2: add test for KT-56520, case (7), qualifier receivers (2.1)

This commit covers object vs companion member vs static member case
in situation with only one companion in the scope.
K1 reports UNRESOLVED_REFERENCE here, probably due to ambiguity.
About K2, while resolving Some.foo it first tries to resolve Some
as a "general" variable access, and gets only some2/Some
because it has a companion. Then it tries to resolve Some as a qualifier,
but here we have an ambiguity, so finally Some with companion is preferred.
This commit is contained in:
Mikhail Glukhikh
2023-10-30 13:55:26 +01:00
committed by Space Team
parent c2ac9daa7f
commit ab161333a7
8 changed files with 137 additions and 0 deletions
@@ -44797,6 +44797,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierForStaticCase.kt");
}
@Test
@TestMetadata("qualifierStaticObjectOrCompanionMemberCase.kt")
public void testQualifierStaticObjectOrCompanionMemberCase() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase.kt");
}
@Test
@TestMetadata("typeCase.kt")
public void testTypeCase() throws Exception {
@@ -44797,6 +44797,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierForStaticCase.kt");
}
@Test
@TestMetadata("qualifierStaticObjectOrCompanionMemberCase.kt")
public void testQualifierStaticObjectOrCompanionMemberCase() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase.kt");
}
@Test
@TestMetadata("typeCase.kt")
public void testTypeCase() throws Exception {