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.
This commit is contained in:
Dmitry Petrov
2021-05-17 15:56:41 +03:00
committed by TeamCityServer
parent 80ce3a5cf8
commit 3a0e3798ec
23 changed files with 612 additions and 60 deletions
@@ -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");
}
}
}
@@ -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<IrValueParameter, IrExpression>? = 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
}
}
}
@@ -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()
@@ -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()
@@ -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()
@@ -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()
@@ -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()
@@ -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()
@@ -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()
@@ -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()
@@ -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");
}
}
}
@@ -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");
}
}
}
@@ -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");
}
}
}
@@ -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");
}
}
}
@@ -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");
}
}
}
@@ -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");
}
}
}
@@ -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");
}
}
}