diff --git a/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt b/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt new file mode 100644 index 00000000000..e18162f5f56 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt @@ -0,0 +1,22 @@ +// !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField +// IGNORE_BACKEND: JVM_IR +// ^ TODO implement ProperVisibilityForCompanionObjectInstanceField feature support in JMV_IR + +// FILE: Base.kt +package a + +open class Base { + protected companion object { + fun foo() = 1 + } +} + +// FILE: Host.kt +import a.* + +class Host : Base() { + fun test() = { foo() } +} + +// @Host.class: +// 1 synthetic access\$ \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt b/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt new file mode 100644 index 00000000000..75cfea23ee0 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt @@ -0,0 +1,20 @@ +// !LANGUAGE: -ProperVisibilityForCompanionObjectInstanceField + +// FILE: Base.kt +package a + +open class Base { + protected companion object { + fun foo() = 1 + } +} + +// FILE: Host.kt +import a.* + +class Host : Base() { + fun test() = { foo() } +} + +// @Host.class: +// 0 synthetic access\$ \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 833294c950a..b6b7271428b 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -930,6 +930,16 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { public void testPrivateCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_before.kt"); } + + @TestMetadata("protectedCompanionObjectAccessors_after.kt") + public void testProtectedCompanionObjectAccessors_after() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt"); + } + + @TestMetadata("protectedCompanionObjectAccessors_before.kt") + public void testProtectedCompanionObjectAccessors_before() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt"); + } } @TestMetadata("compiler/testData/codegen/bytecodeText/conditions") diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 814e8e82cd0..708e04d19fa 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -930,6 +930,16 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { public void testPrivateCompanionObjectAccessors_before() throws Exception { runTest("compiler/testData/codegen/bytecodeText/companion/privateCompanionObjectAccessors_before.kt"); } + + @TestMetadata("protectedCompanionObjectAccessors_after.kt") + public void testProtectedCompanionObjectAccessors_after() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_after.kt"); + } + + @TestMetadata("protectedCompanionObjectAccessors_before.kt") + public void testProtectedCompanionObjectAccessors_before() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/companion/protectedCompanionObjectAccessors_before.kt"); + } } @TestMetadata("compiler/testData/codegen/bytecodeText/conditions")