From 3a0e3798ec1e93c3c04203f2634d58a140ee5c3f Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Mon, 17 May 2021 15:56:41 +0300 Subject: [PATCH] JVM_IR KT-46597 fix receiver type for inlined callable reference Receiver type is used by SyntheticAccessorLowering to determine class in which a synthetic accessor should be generated. --- .../FirBlackBoxCodegenTestGenerated.java | 78 ++++++++++++++++--- .../lower/InlineCallableReferenceToLambda.kt | 42 +++++++++- .../kt46578_anonObject.kt | 0 .../kt46578_delegated.kt | 0 .../kt46578_kotlin_delegated.kt | 0 .../kt46578_kotlin_propertyRef.kt | 0 .../kt46578_lambda.kt | 0 .../kt46578_propertyRef.kt | 0 .../kt46597_crossinline_java_field.kt | 21 +++++ .../kt46597_crossinline_jvmField_property.kt | 24 ++++++ .../kt46597_crossinline_method.kt | 21 +++++ .../kt46597_crossinline_property.kt | 22 ++++++ .../kt46597_java_field.kt | 18 +++++ .../kt46597_jvmField_property.kt | 19 +++++ .../kt46597_method.kt | 17 ++++ .../kt46597_property.kt | 17 ++++ .../codegen/BlackBoxCodegenTestGenerated.java | 78 ++++++++++++++++--- .../IrBlackBoxCodegenTestGenerated.java | 78 ++++++++++++++++--- .../LightAnalysisModeTestGenerated.java | 73 ++++++++++++++--- .../IrJsCodegenBoxES6TestGenerated.java | 41 +++++++++- .../IrJsCodegenBoxTestGenerated.java | 41 +++++++++- .../semantics/JsCodegenBoxTestGenerated.java | 41 +++++++++- .../IrCodegenBoxWasmTestGenerated.java | 41 +++++++++- 23 files changed, 612 insertions(+), 60 deletions(-) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_anonObject.kt (100%) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_delegated.kt (100%) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_kotlin_delegated.kt (100%) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_kotlin_propertyRef.kt (100%) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_lambda.kt (100%) rename compiler/testData/codegen/box/syntheticAccessors/{kt46578 => protectedJavaFieldAccessor}/kt46578_propertyRef.kt (100%) create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt create mode 100644 compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt 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 aafa138aeb4..92d909fd1d1 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 @@ -40281,48 +40281,106 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } @Nested - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") - public class Kt46578 { + public class ProtectedJavaFieldAccessor { @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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), 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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt"); } @Test @TestMetadata("kt46578_delegated.kt") public void testKt46578_delegated() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt"); } @Test @TestMetadata("kt46578_propertyRef.kt") public void testKt46578_propertyRef() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + public class ProtectedMemberReferenceAccessor { + @Test + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt46597_crossinline_java_field.kt") + public void testKt46597_crossinline_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_jvmField_property.kt") + public void testKt46597_crossinline_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @Test + @TestMetadata("kt46597_java_field.kt") + public void testKt46597_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_jvmField_property.kt") + public void testKt46597_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @Test + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InlineCallableReferenceToLambda.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InlineCallableReferenceToLambda.kt index 8a09db6da07..59a8455f8ba 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InlineCallableReferenceToLambda.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InlineCallableReferenceToLambda.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionReferenceImpl import org.jetbrains.kotlin.ir.types.IrSimpleType +import org.jetbrains.kotlin.ir.types.IrType import org.jetbrains.kotlin.ir.types.IrTypeProjection import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid @@ -124,10 +125,43 @@ private class InlineCallableReferenceToLambdaTransformer( } } + private class BoundReceiver( + val receiverParameter: IrValueParameter, + val receiverValue: IrExpression, + val receiverType: IrType + ) + + private fun IrCallableReference<*>.getBoundReceiver(): BoundReceiver? { + val irFunction = when (this) { + is IrFunctionReference -> + this.symbol.owner + is IrPropertyReference -> + this.getter!!.owner + else -> + throw AssertionError("Unexpected callable reference: ${this.render()}") + } + + this.dispatchReceiver?.let { dispatchReceiver -> + val dispatchReceiverParameter = irFunction.dispatchReceiverParameter + ?: throw AssertionError("Referenced declaration '${this.symbol.owner.render()}' has no dispatch receiver: ${this.dump()}") + // NB in case of fake override of Base::foo in Child::foo, dispatch receiver type is Base, + // but we in fact need Child (because of accessor generation). + return BoundReceiver(dispatchReceiverParameter, dispatchReceiver, irFunction.parentAsClass.defaultType) + } + + this.extensionReceiver?.let { extensionReceiver -> + val extensionReceiverParameter = irFunction.extensionReceiverParameter + ?: throw AssertionError("Referenced declaration '${this.symbol.owner.render()}' has no extension receiver: ${this.dump()}") + return BoundReceiver(extensionReceiverParameter, extensionReceiver, extensionReceiverParameter.type) + } + + return null + } + private fun expandInlineFunctionReferenceToLambda(expression: IrCallableReference<*>, referencedFunction: IrFunction): IrExpression { val irBuilder = context.createJvmIrBuilder(currentScope!!.scope.scopeOwnerSymbol, expression.startOffset, expression.endOffset) return irBuilder.irBlock(expression, IrStatementOrigin.LAMBDA) { - val boundReceiver: Pair? = expression.getArgumentsWithIr().singleOrNull() + val boundReceiver = expression.getBoundReceiver() val argumentTypes = (expression.type as IrSimpleType).arguments.dropLast(1).map { (it as IrTypeProjection).type } val function = context.irFactory.buildFun { @@ -140,7 +174,7 @@ private class InlineCallableReferenceToLambdaTransformer( }.apply { parent = currentDeclarationParent!! if (boundReceiver != null) { - addExtensionReceiver(boundReceiver.first.type) + addExtensionReceiver(boundReceiver.receiverType) } for ((index, argumentType) in argumentTypes.withIndex()) { addValueParameter { @@ -162,7 +196,7 @@ private class InlineCallableReferenceToLambdaTransformer( var unboundIndex = 0 for (parameter in referencedFunction.explicitParameters) { when { - boundReceiver?.first == parameter -> + boundReceiver?.receiverParameter == parameter -> irGet(extensionReceiverParameter!!) parameter.isVararg && unboundIndex < argumentTypes.size && parameter.type == valueParameters[unboundIndex].type -> irGet(valueParameters[unboundIndex++]) @@ -191,7 +225,7 @@ private class InlineCallableReferenceToLambdaTransformer( origin = IrStatementOrigin.LAMBDA ).apply { copyAttributes(expression) - extensionReceiver = boundReceiver?.second + extensionReceiver = boundReceiver?.receiverValue } } } diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_anonObject.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_delegated.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_delegated.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_kotlin_delegated.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_delegated.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_kotlin_delegated.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_kotlin_propertyRef.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_kotlin_propertyRef.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_kotlin_propertyRef.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt similarity index 100% rename from compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt rename to compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt new file mode 100644 index 00000000000..9d1e53cc0a2 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt @@ -0,0 +1,21 @@ +// TARGET_BACKEND: JVM + +// FILE: a/Base.java +package a; + +public class Base { + protected String property = "OK"; +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = + higherOrder(::property) + + inline fun higherOrder(crossinline lambda: () -> String) = + lambda() +} + +fun box() = SubClass().call() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt new file mode 100644 index 00000000000..e695aca4758 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR +// WITH_RUNTIME + +// FILE: a.kt +package a + +abstract class Base { + @JvmField + protected val property = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = + higherOrder(::property) + + inline fun higherOrder(crossinline lambda: () -> String) = + lambda() +} + +fun box() = SubClass().call() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt new file mode 100644 index 00000000000..c9e81a1118e --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt @@ -0,0 +1,21 @@ +// IGNORE_BACKEND_FIR: JVM_IR + +// FILE: a.kt +package a + +abstract class Base { + protected fun method() = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = + higherOrder(::method) + + inline fun higherOrder(crossinline lambda: () -> String) = + lambda() +} + +fun box() = SubClass().call() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt new file mode 100644 index 00000000000..9cd15e8b9fa --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt @@ -0,0 +1,22 @@ +// IGNORE_BACKEND: WASM +// IGNORE_BACKEND_FIR: JVM_IR + +// FILE: a.kt +package a + +abstract class Base { + protected val property get() = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = + higherOrder(::property) + + inline fun higherOrder(crossinline lambda: () -> String) = + lambda() +} + +fun box() = SubClass().call() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt new file mode 100644 index 00000000000..2b8d03be5a8 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND_FIR: JVM_IR + +// FILE: a/Base.java +package a; + +public class Base { + protected String property = "OK"; +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = ::property +} + +fun box() = SubClass().call().invoke() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt new file mode 100644 index 00000000000..df39d043855 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt @@ -0,0 +1,19 @@ +// TARGET_BACKEND: JVM +// WITH_RUNTIME + +// FILE: a.kt +package a + +abstract class Base { + @JvmField + protected val property = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = ::property +} + +fun box() = SubClass().call().invoke() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt new file mode 100644 index 00000000000..ba47e6aed6a --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt @@ -0,0 +1,17 @@ +// IGNORE_BACKEND: WASM + +// FILE: a.kt +package a + +abstract class Base { + protected fun method() = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = ::method +} + +fun box() = SubClass().call().invoke() diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt new file mode 100644 index 00000000000..10d148c2651 --- /dev/null +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt @@ -0,0 +1,17 @@ +// IGNORE_BACKEND: WASM + +// FILE: a.kt +package a + +abstract class Base { + protected val property get() = "OK" +} + +// FILE: b.kt +import a.Base + +class SubClass : Base() { + fun call() = ::property +} + +fun box() = SubClass().call().invoke() 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 d23d7e412e7..4bf8cfe3ba2 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 @@ -40257,48 +40257,106 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } @Nested - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") - public class Kt46578 { + public class ProtectedJavaFieldAccessor { @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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), 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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt"); } @Test @TestMetadata("kt46578_delegated.kt") public void testKt46578_delegated() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt"); } @Test @TestMetadata("kt46578_propertyRef.kt") public void testKt46578_propertyRef() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + public class ProtectedMemberReferenceAccessor { + @Test + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("kt46597_crossinline_java_field.kt") + public void testKt46597_crossinline_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_jvmField_property.kt") + public void testKt46597_crossinline_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @Test + @TestMetadata("kt46597_java_field.kt") + public void testKt46597_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_jvmField_property.kt") + public void testKt46597_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @Test + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } 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 cb7364c73eb..a6f16e4b80f 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 @@ -40281,48 +40281,106 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } @Nested - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") - public class Kt46578 { + public class ProtectedJavaFieldAccessor { @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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), 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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt"); } @Test @TestMetadata("kt46578_delegated.kt") public void testKt46578_delegated() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt"); } @Test @TestMetadata("kt46578_propertyRef.kt") public void testKt46578_propertyRef() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + public class ProtectedMemberReferenceAccessor { + @Test + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("kt46597_crossinline_java_field.kt") + public void testKt46597_crossinline_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_jvmField_property.kt") + public void testKt46597_crossinline_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @Test + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @Test + @TestMetadata("kt46597_java_field.kt") + public void testKt46597_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt"); + } + + @Test + @TestMetadata("kt46597_jvmField_property.kt") + public void testKt46597_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt"); + } + + @Test + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @Test + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 2365c7a1771..ebd566c076f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -32276,46 +32276,99 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/syntheticAccessors/syntheticAccessorNames.kt"); } - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Kt46578 extends AbstractLightAnalysisModeTest { + public static class ProtectedJavaFieldAccessor 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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), 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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_anonObject.kt"); } @TestMetadata("kt46578_delegated.kt") public void testKt46578_delegated() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_delegated.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/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"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_kotlin_propertyRef.kt"); } @TestMetadata("kt46578_lambda.kt") public void testKt46578_lambda() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_lambda.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_lambda.kt"); } @TestMetadata("kt46578_propertyRef.kt") public void testKt46578_propertyRef() throws Exception { - runTest("compiler/testData/codegen/box/syntheticAccessors/kt46578/kt46578_propertyRef.kt"); + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor/kt46578_propertyRef.kt"); + } + } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedMemberReferenceAccessor extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("kt46597_crossinline_java_field.kt") + public void testKt46597_crossinline_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_java_field.kt"); + } + + @TestMetadata("kt46597_crossinline_jvmField_property.kt") + public void testKt46597_crossinline_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_jvmField_property.kt"); + } + + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @TestMetadata("kt46597_java_field.kt") + public void testKt46597_java_field() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_java_field.kt"); + } + + @TestMetadata("kt46597_jvmField_property.kt") + public void testKt46597_jvmField_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_jvmField_property.kt"); + } + + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } 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 9643778aad4..7b62ea6872c 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 @@ -27116,16 +27116,49 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Kt46578 extends AbstractIrJsCodegenBoxES6Test { + public static class ProtectedJavaFieldAccessor 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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedMemberReferenceAccessor extends AbstractIrJsCodegenBoxES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } 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 1aebe7bd7e1..84108a71c0e 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 @@ -26522,16 +26522,49 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Kt46578 extends AbstractIrJsCodegenBoxTest { + public static class ProtectedJavaFieldAccessor 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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedMemberReferenceAccessor extends AbstractIrJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } 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 f52e0f502c3..d198a452c02 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 @@ -26482,16 +26482,49 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Kt46578 extends AbstractJsCodegenBoxTest { + public static class ProtectedJavaFieldAccessor 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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedMemberReferenceAccessor extends AbstractJsCodegenBoxTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } } 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 304e5f92930..08bbae68371 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 @@ -14778,16 +14778,49 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/syntheticAccessors/superCallFromMultipleSubclasses.kt"); } - @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/kt46578") + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) - public static class Kt46578 extends AbstractIrCodegenBoxWasmTest { + public static class ProtectedJavaFieldAccessor 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); + public void testAllFilesPresentInProtectedJavaFieldAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedJavaFieldAccessor"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + + @TestMetadata("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProtectedMemberReferenceAccessor extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInProtectedMemberReferenceAccessor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @TestMetadata("kt46597_crossinline_method.kt") + public void testKt46597_crossinline_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_method.kt"); + } + + @TestMetadata("kt46597_crossinline_property.kt") + public void testKt46597_crossinline_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_crossinline_property.kt"); + } + + @TestMetadata("kt46597_method.kt") + public void testKt46597_method() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_method.kt"); + } + + @TestMetadata("kt46597_property.kt") + public void testKt46597_property() throws Exception { + runTest("compiler/testData/codegen/box/syntheticAccessors/protectedMemberReferenceAccessor/kt46597_property.kt"); } } }