K2: add test for KT-56520, case (7), qualifier receivers (4.1)
This commit covers enum entry vs companion member case, when one companion object is 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 the only candidate with companion. After that it tries to resolve Some as a qualifier, but we have no scope with a single qualifier, so no influence here. Finally during foo resolve it should choose between enum entry and companion member, and enum entry wins due to KT-37591.
This commit is contained in:
committed by
Space Team
parent
76b2b9fc66
commit
63ce4ba6b0
+6
@@ -44791,6 +44791,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/constructorCaseSpace.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierEnumEntryOrCompanionMemberCase.kt")
|
||||
public void testQualifierEnumEntryOrCompanionMemberCase() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierEnumEntryOrCompanionMemberCase.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierForStaticCase.kt")
|
||||
public void testQualifierForStaticCase() throws Exception {
|
||||
|
||||
+6
@@ -44791,6 +44791,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/constructorCaseSpace.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierEnumEntryOrCompanionMemberCase.kt")
|
||||
public void testQualifierEnumEntryOrCompanionMemberCase() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierEnumEntryOrCompanionMemberCase.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierForStaticCase.kt")
|
||||
public void testQualifierForStaticCase() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user