K2: add test for KT-56520, case (7), qualifier receivers (2.2)
This commit covers object vs companion member vs static member case but now we have two different companions (first is empty) 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 some/Some & some2/Some because both of them have a companion. This means ambiguity. After it tries to resolve Some as a qualifier, but we have no scope with a single qualifier, so finally we prefer to report ambiguity from variable access resolve.
This commit is contained in:
committed by
Space Team
parent
ab161333a7
commit
602801dcfd
+6
@@ -44803,6 +44803,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierStaticObjectOrCompanionMemberCase2.kt")
|
||||
public void testQualifierStaticObjectOrCompanionMemberCase2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeCase.kt")
|
||||
public void testTypeCase() throws Exception {
|
||||
|
||||
+6
@@ -44803,6 +44803,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierStaticObjectOrCompanionMemberCase2.kt")
|
||||
public void testQualifierStaticObjectOrCompanionMemberCase2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/resolve/ambiguousTypeReferences/qualifierStaticObjectOrCompanionMemberCase2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeCase.kt")
|
||||
public void testTypeCase() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user