K2: add test for KT-55371
This commit is contained in:
committed by
Space Team
parent
c074cf6635
commit
416d4f57eb
+6
@@ -28962,6 +28962,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaVisibility/package"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaVisibility/package"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("cannotAccessStaticMemberViaReceiver.kt")
|
||||||
|
public void testCannotAccessStaticMemberViaReceiver() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/javaVisibility/package/cannotAccessStaticMemberViaReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inheritedPackageStaticField.kt")
|
@TestMetadata("inheritedPackageStaticField.kt")
|
||||||
public void testInheritedPackageStaticField() throws Exception {
|
public void testInheritedPackageStaticField() throws Exception {
|
||||||
|
|||||||
Vendored
+33
@@ -0,0 +1,33 @@
|
|||||||
|
// TARGET_BACKEND: JVM_IR
|
||||||
|
// IGNORE_BACKEND_K2: JVM_IR
|
||||||
|
// See KT-55371
|
||||||
|
// FILE: javapackage/PackagePrivateGrandparentAbstractClass.java
|
||||||
|
|
||||||
|
package javapackage;
|
||||||
|
|
||||||
|
/*package-private*/ abstract class PackagePrivateGrandparentAbstractClass {
|
||||||
|
public static void publicStaticMethod() {}
|
||||||
|
|
||||||
|
public static String publicStaticField = "OK";
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: javapackage/PublicParentClass.java
|
||||||
|
|
||||||
|
package javapackage;
|
||||||
|
|
||||||
|
public class PublicParentClass extends PackagePrivateGrandparentAbstractClass {}
|
||||||
|
|
||||||
|
// FILE: Child.kt
|
||||||
|
|
||||||
|
import javapackage.PublicParentClass
|
||||||
|
|
||||||
|
class Child : PublicParentClass() {
|
||||||
|
fun foo(): String {
|
||||||
|
publicStaticMethod()
|
||||||
|
return publicStaticField
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: test.kt
|
||||||
|
|
||||||
|
fun box() = Child().foo()
|
||||||
+6
@@ -28962,6 +28962,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaVisibility/package"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/javaVisibility/package"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("cannotAccessStaticMemberViaReceiver.kt")
|
||||||
|
public void testCannotAccessStaticMemberViaReceiver() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/javaVisibility/package/cannotAccessStaticMemberViaReceiver.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("inheritedPackageStaticField.kt")
|
@TestMetadata("inheritedPackageStaticField.kt")
|
||||||
public void testInheritedPackageStaticField() throws Exception {
|
public void testInheritedPackageStaticField() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user