K1/K2: add test confirming the work of KT-54487 case
#KT-54487 Obsolete #KT-63350 Declined
This commit is contained in:
committed by
Space Team
parent
601f90917b
commit
4783822fbc
+6
@@ -20144,6 +20144,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+6
@@ -20144,6 +20144,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+6
@@ -19819,6 +19819,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+6
@@ -19819,6 +19819,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+6
@@ -19819,6 +19819,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// ISSUE: KT-54487, KT-63350
|
||||
// FILE: p/I.java
|
||||
|
||||
package p;
|
||||
|
||||
public interface I {
|
||||
String foo();
|
||||
}
|
||||
|
||||
// FILE: p/I2.java
|
||||
|
||||
package p;
|
||||
|
||||
public interface I2 extends I {}
|
||||
|
||||
// FILE: p/C.java
|
||||
|
||||
package p;
|
||||
|
||||
public class C {
|
||||
static class Impl implements I {
|
||||
public String foo() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
static class C1Base extends Impl {}
|
||||
static class C2Base extends Impl {}
|
||||
|
||||
public static class C1 extends C1Base implements I2 {}
|
||||
public static class C2 extends C2Base implements I2 {}
|
||||
|
||||
public static final C1 c1 = new C1();
|
||||
public static final C2 c2 = new C2();
|
||||
}
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
import p.C
|
||||
|
||||
fun <T> union(a: T, b: T) = a
|
||||
|
||||
fun box() =
|
||||
// receiver type = I2 & C.Impl
|
||||
// method resolved to C.Impl.foo, but in backend IR the resulting call is I2.foo
|
||||
union(C.c1, C.c2).foo()
|
||||
+6
@@ -19819,6 +19819,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+6
@@ -19819,6 +19819,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
|
||||
+5
@@ -16537,6 +16537,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/fir/notFoundClasses.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("publicMethodCallViaPackagePrivateCommon.kt")
|
||||
public void testPublicMethodCallViaPackagePrivateCommon() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/publicMethodCallViaPackagePrivateCommon.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("SamWithReceiverMavenProjectImportHandler.kt")
|
||||
public void testSamWithReceiverMavenProjectImportHandler() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
|
||||
Reference in New Issue
Block a user