diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 7e1c1fe48c6..aafa138aeb4 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -40279,6 +40279,52 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT public void testSyntheticAccessorNames() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/syntheticAccessorNames.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + public class Kt46578 { + @Test + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt46578_anonObject.kt") + public void testKt46578_anonObject() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt"); + } + + @Test + @TestMetadata("kt46578_delegated.kt") + public void testKt46578_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_delegated.kt") + public void testKt46578_kotlin_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_propertyRef.kt") + public void testKt46578_kotlin_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt"); + } + + @Test + @TestMetadata("kt46578_lambda.kt") + public void testKt46578_lambda() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt"); + } + + @Test + @TestMetadata("kt46578_propertyRef.kt") + public void testKt46578_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + } + } } @Nested diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index 512ecc231d4..6fef7d8b85d 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -232,11 +232,11 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle override fun visitGetField(expression: IrGetField): IrExpression { val dispatchReceiverType = expression.receiver?.type + val dispatchReceiverClassSymbol = dispatchReceiverType?.classifierOrNull as? IrClassSymbol return super.visitExpression( - if (!expression.symbol.isAccessible(false, dispatchReceiverType?.classifierOrNull as? IrClassSymbol)) { + if (!expression.symbol.isAccessible(false, dispatchReceiverClassSymbol)) { val symbol = expression.symbol - val parent = - symbol.owner.accessorParent(dispatchReceiverType?.classOrNull?.owner ?: symbol.owner.parent) as IrClass + val parent = symbol.owner.accessorParent(dispatchReceiverClassSymbol?.owner ?: symbol.owner.parent) as IrClass modifyGetterExpression( expression, getterMap.getOrPut(FieldKey(symbol, parent, expression.superQualifierSymbol)) { @@ -251,11 +251,11 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle override fun visitSetField(expression: IrSetField): IrExpression { val dispatchReceiverType = expression.receiver?.type + val dispatchReceiverClassSymbol = dispatchReceiverType?.classifierOrNull as? IrClassSymbol return super.visitExpression( - if (!expression.symbol.isAccessible(false, dispatchReceiverType?.classifierOrNull as? IrClassSymbol)) { + if (!expression.symbol.isAccessible(false, dispatchReceiverClassSymbol)) { val symbol = expression.symbol - val parent = - symbol.owner.accessorParent(dispatchReceiverType?.classOrNull?.owner ?: symbol.owner.parent) as IrClass + val parent = symbol.owner.accessorParent(dispatchReceiverClassSymbol?.owner ?: symbol.owner.parent) as IrClass modifySetterExpression( expression, setterMap.getOrPut(FieldKey(symbol, parent, expression.superQualifierSymbol)) { @@ -725,8 +725,26 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle if (symbolOwner is IrConstructor && symbolOwner.parentClassOrNull?.isEnumEntry == true) return true - val declaration = - (declarationRaw as? IrSimpleFunction)?.resolveFakeOverride(allowAbstract = true) ?: declarationRaw + val declaration = when (declarationRaw) { + is IrSimpleFunction -> + declarationRaw.resolveFakeOverride(allowAbstract = true) + ?: declarationRaw + is IrField -> { + val correspondingProperty = declarationRaw.correspondingPropertySymbol?.owner + if (correspondingProperty != null && correspondingProperty.isFakeOverride) { + val realProperty = correspondingProperty.resolveFakeOverrideForProperty() + realProperty.backingField + ?: throw AssertionError( + "Fake override property ${correspondingProperty.render()} with backing field " + + "overrides a real property with no backing field: ${realProperty.render()}" + ) + } else { + declarationRaw + } + } + else -> + declarationRaw + } // If local variables are accessible by Kotlin rules, they also are by Java rules. val ownerClass = declaration.parent as? IrClass ?: return true @@ -747,6 +765,16 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle } } + private fun IrProperty.resolveFakeOverrideForProperty(): IrProperty { + if (!isFakeOverride) return this + + return this.overriddenSymbols + .map { it.owner } + .collectAndFilterRealOverrides() + .firstOrNull() as? IrProperty + ?: throw AssertionError("No real override for ${this.render()}") + } + private class OuterClassInfo(val outerClass: IrClass, val throughCrossinlineLambda: Boolean) private fun getOuterClassInfo(): OuterClassInfo? { diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt new file mode 100644 index 00000000000..c677a8a1794 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt @@ -0,0 +1,26 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// FILE: kt46578_anonObject.kt +import p.* + +class Derived : Base() { + init { + javaProtectedField = "OK" + } + val anonObject = object { + override fun toString(): String = + javaProtectedField + } +} + +fun box(): String { + return Derived().anonObject.toString() +} + +// FILE: p/Base.java +package p; + +public class Base { + protected String javaProtectedField; +} diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt new file mode 100644 index 00000000000..7dac6e89318 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// IGNORE_BACKEND_FIR: JVM_IR +// ^ ::jpf is incorrectly represented as a reference to Base::jpf (should be: reference to fake override in Derived) + +// FILE: kt46578_delegated.kt +import p.* + +class Derived : Base() { + var delegated by ::jpf +} + +fun box(): String { + val d = Derived() + d.delegated = "OK" + return d.delegated +} + +// FILE: p/Base.java +package p; + +public class Base { + protected String jpf; +} diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt new file mode 100644 index 00000000000..0607f3f5a18 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// FILE: kt46578_kotlin_delegated.kt +import p.* + +class Derived : Base() { + init { + pf = "OK" + } + val delegated by ::pf +} + +fun box(): String { + return Derived().delegated +} + +// FILE: p/Base.kt +package p + +open class Base { + protected var pf = "" +} diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt new file mode 100644 index 00000000000..d10c0ffa954 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// FILE: kt46578_kotlin_propertyRef.kt +import p.* + +class Derived : Base() { + init { + pf = "OK" + } + val ref = ::pf +} + +fun box(): String { + return Derived().ref.get() +} + +// FILE: p/Base.kt +package p + +open class Base { + protected var pf = "" +} diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt new file mode 100644 index 00000000000..d7e8161236e --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt @@ -0,0 +1,23 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// FILE: kt46578_lambda.kt +import p.* + +class Derived : Base() { + init { + jpf = "OK" + } + val lambda = { jpf } +} + +fun box(): String { + return Derived().lambda() +} + +// FILE: p/Base.java +package p; + +public class Base { + protected String jpf; +} diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt new file mode 100644 index 00000000000..0aea9ef584d --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt @@ -0,0 +1,25 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME +// IGNORE_BACKEND_FIR: JVM_IR +// ^ ::jpf is incorrectly represented as a reference to Base::jpf (should be: reference to fake override in Derived) + +// FILE: kt46578_propertyRef.kt +import p.* + +class Derived : Base() { + init { + jpf = "OK" + } + val ref = ::jpf +} + +fun box(): String { + return Derived().ref.get() +} + +// FILE: p/Base.java +package p; + +public class Base { + protected String jpf; +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index ee276fd0081..d23d7e412e7 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -40255,6 +40255,52 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { public void testSyntheticAccessorNames() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/syntheticAccessorNames.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + public class Kt46578 { + @Test + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("kt46578_anonObject.kt") + public void testKt46578_anonObject() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt"); + } + + @Test + @TestMetadata("kt46578_delegated.kt") + public void testKt46578_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_delegated.kt") + public void testKt46578_kotlin_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_propertyRef.kt") + public void testKt46578_kotlin_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt"); + } + + @Test + @TestMetadata("kt46578_lambda.kt") + public void testKt46578_lambda() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt"); + } + + @Test + @TestMetadata("kt46578_propertyRef.kt") + public void testKt46578_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + } + } } @Nested diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index eb69cea0372..cb7364c73eb 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -40279,6 +40279,52 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes public void testSyntheticAccessorNames() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/syntheticAccessorNames.kt"); } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + public class Kt46578 { + @Test + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt46578_anonObject.kt") + public void testKt46578_anonObject() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt"); + } + + @Test + @TestMetadata("kt46578_delegated.kt") + public void testKt46578_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_delegated.kt") + public void testKt46578_kotlin_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt"); + } + + @Test + @TestMetadata("kt46578_kotlin_propertyRef.kt") + public void testKt46578_kotlin_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt"); + } + + @Test + @TestMetadata("kt46578_lambda.kt") + public void testKt46578_lambda() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt"); + } + + @Test + @TestMetadata("kt46578_propertyRef.kt") + public void testKt46578_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + } + } } @Nested diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 5c25046fb18..2365c7a1771 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -32275,6 +32275,49 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testSyntheticAccessorNames() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/syntheticAccessorNames.kt"); } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46578 extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("kt46578_anonObject.kt") + public void testKt46578_anonObject() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt"); + } + + @TestMetadata("kt46578_delegated.kt") + public void testKt46578_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + } + + @TestMetadata("kt46578_kotlin_delegated.kt") + public void testKt46578_kotlin_delegated() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt"); + } + + @TestMetadata("kt46578_kotlin_propertyRef.kt") + public void testKt46578_kotlin_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt"); + } + + @TestMetadata("kt46578_lambda.kt") + public void testKt46578_lambda() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt"); + } + + @TestMetadata("kt46578_propertyRef.kt") + public void testKt46578_propertyRef() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + } + } } @TestMetadata("compiler/testData/codegen/box/syntheticExtensions") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index b733df83763..9643778aad4 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -27115,6 +27115,19 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes public void testSuperCallFromMultipleSubclasses() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46578 extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } } @TestMetadata("compiler/testData/codegen/box/syntheticExtensions") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index d15b7f67a0a..1aebe7bd7e1 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -26521,6 +26521,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { public void testSuperCallFromMultipleSubclasses() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46578 extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } } @TestMetadata("compiler/testData/codegen/box/syntheticExtensions") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 8b5494c0479..f52e0f502c3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -26481,6 +26481,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { public void testSuperCallFromMultipleSubclasses() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46578 extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } } @TestMetadata("compiler/testData/codegen/box/syntheticExtensions") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index a74404f054a..304e5f92930 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -14777,6 +14777,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest public void testSuperCallFromMultipleSubclasses() throws Exception { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Kt46578 extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInKt46578() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/kt46578"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } } @TestMetadata("compiler/testData/codegen/box/syntheticExtensions")