diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrInlineReferenceLocator.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrInlineReferenceLocator.kt index b4214224d43..c8b2a697cc6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrInlineReferenceLocator.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/ir/IrInlineReferenceLocator.kt @@ -12,16 +12,11 @@ import org.jetbrains.kotlin.backend.jvm.codegen.isInlineIrExpression import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.declarations.IrDeclaration import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.declarations.IrValueParameter import org.jetbrains.kotlin.ir.expressions.* import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid internal open class IrInlineReferenceLocator(private val context: JvmBackendContext) : IrElementVisitorVoidWithContext() { - val inlineReferences = mutableSetOf() - - // For crossinline lambdas, the call site is null as it's probably in a separate class somewhere. - // All other lambdas are guaranteed to be inlined into the scope they are declared in. - val lambdaToCallSite = mutableMapOf() - override fun visitElement(element: IrElement) = element.acceptChildrenVoid(this) override fun visitFunctionAccess(expression: IrFunctionAccessExpression) { @@ -35,37 +30,30 @@ internal open class IrInlineReferenceLocator(private val context: JvmBackendCont if (!isInlineIrExpression(valueArgument)) continue - if (valueArgument is IrPropertyReference) { - handleInlineFunctionCallableReferenceParam(valueArgument) - continue - } - - val reference = when (valueArgument) { - is IrFunctionReference -> valueArgument - is IrBlock -> valueArgument.statements.filterIsInstance().singleOrNull() - else -> null - } ?: continue - - handleInlineFunctionCallableReferenceParam(reference) if (valueArgument is IrBlock && valueArgument.origin.isLambda) { - val declaration = if (parameter.isCrossinline) null else currentScope!!.irElement as IrDeclaration - handleInlineFunctionLambdaParam(reference, function, declaration) + val reference = valueArgument.statements.last() as IrFunctionReference + visitInlineLambda(reference, function, parameter, currentScope!!.irElement as IrDeclaration) + } else if (valueArgument is IrCallableReference) { + visitInlineReference(valueArgument) } } } return super.visitFunctionAccess(expression) } - open fun handleInlineFunctionCallableReferenceParam(valueArgument: IrCallableReference) { - inlineReferences.add(valueArgument) - } + open fun visitInlineReference(argument: IrCallableReference) {} - open fun handleInlineFunctionLambdaParam(lambdaReference: IrFunctionReference, callee: IrFunction, callSite: IrDeclaration?) { - lambdaToCallSite[lambdaReference.symbol.owner] = callSite - } + open fun visitInlineLambda(argument: IrFunctionReference, callee: IrFunction, parameter: IrValueParameter, scope: IrDeclaration) = + visitInlineReference(argument) companion object { - fun scan(context: JvmBackendContext, element: IrElement) = - IrInlineReferenceLocator(context).apply { element.accept(this, null) } + fun scan(context: JvmBackendContext, element: IrElement): Set = + mutableSetOf().apply { + element.accept(object : IrInlineReferenceLocator(context) { + override fun visitInlineReference(argument: IrCallableReference) { + add(argument) + } + }, null) + } } } \ No newline at end of file diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt index bad5ada9a33..8ea93319c87 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/AddContinuationLowering.kt @@ -641,17 +641,18 @@ private class AddContinuationLowering(private val context: JvmBackendContext) : private fun markSuspendLambdas(irElement: IrElement): Pair, List> { val suspendLambdas = arrayListOf() val capturesCrossinline = mutableSetOf() - val visitor = object : IrInlineReferenceLocator(context) { + val inlineReferences = mutableSetOf() + irElement.acceptChildrenVoid(object : IrInlineReferenceLocator(context) { override fun visitElement(element: IrElement) { element.acceptChildrenVoid(this) } - override fun handleInlineFunctionCallableReferenceParam(valueArgument: IrCallableReference) { - super.handleInlineFunctionCallableReferenceParam(valueArgument) - val getValue = (valueArgument as? IrGetValue) ?: return + override fun visitInlineReference(argument: IrCallableReference) { + inlineReferences.add(argument) + val getValue = (argument as? IrGetValue) ?: return val parameter = getValue.symbol.owner as? IrValueParameter ?: return if (parameter.isCrossinline) { - capturesCrossinline += valueArgument + capturesCrossinline += argument } } @@ -676,9 +677,8 @@ private class AddContinuationLowering(private val context: JvmBackendContext) : ) } } - } - irElement.acceptChildrenVoid(visitor) - return suspendLambdas to visitor.inlineReferences.map { it.symbol.owner as IrFunction } + }) + return suspendLambdas to inlineReferences.map { it.symbol.owner as IrFunction } } private class SuspendLambdaInfo( diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt index 773fe39ddc2..cf748bdc3c1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/CallableReferenceLowering.kt @@ -56,7 +56,7 @@ internal class CallableReferenceLowering(private val context: JvmBackendContext) private fun IrFunctionReference.isSuspendCallableReference(): Boolean = isSuspend && origin == null override fun lower(irFile: IrFile) { - ignoredFunctionReferences.addAll(IrInlineReferenceLocator.scan(context, irFile).inlineReferences) + ignoredFunctionReferences.addAll(IrInlineReferenceLocator.scan(context, irFile)) irFile.transformChildrenVoid(this) } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt index 78b1e0f0e4c..ec64b8c5b0b 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FakeInliningLocalVariablesLowering.kt @@ -14,12 +14,8 @@ import org.jetbrains.kotlin.ir.builders.createTmpVariable import org.jetbrains.kotlin.ir.builders.irBlockBody import org.jetbrains.kotlin.ir.builders.irInt import org.jetbrains.kotlin.ir.builders.irReturn -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin -import org.jetbrains.kotlin.ir.declarations.IrFile -import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrBlockBody -import org.jetbrains.kotlin.ir.expressions.IrCallableReference import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.expressions.IrFunctionReference import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid @@ -44,16 +40,11 @@ internal class FakeInliningLocalVariablesLowering(val context: JvmBackendContext } } - override fun handleInlineFunctionCallableReferenceParam(valueArgument: IrCallableReference) { - // Do not record inline function callable reference parameters. They will not be used. - } - - override fun handleInlineFunctionLambdaParam(lambdaReference: IrFunctionReference, callee: IrFunction, callSite: IrDeclaration?) { - // Do not record lambda parameters. Instead deal with them now. - val lambda = lambdaReference.symbol.owner + override fun visitInlineLambda(argument: IrFunctionReference, callee: IrFunction, parameter: IrValueParameter, scope: IrDeclaration) { + val lambda = argument.symbol.owner if (lambda.origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA) { val argumentToFunctionName = context.methodSignatureMapper.mapFunctionName(callee) - val lambdaReferenceName = context.getLocalClassType(lambdaReference)!!.internalName.substringAfterLast("/") + val lambdaReferenceName = context.getLocalClassType(argument)!!.internalName.substringAfterLast("/") val localName = "${JvmAbi.LOCAL_VARIABLE_NAME_PREFIX_INLINE_ARGUMENT}-$argumentToFunctionName-$lambdaReferenceName" lambda.addFakeLocalVariable(localName) } 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 791a5ec4242..2ee95d92a21 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 @@ -50,9 +50,7 @@ internal class InlineCallableReferenceToLambdaPhase(val context: JvmBackendConte private var inlinableReferences = mutableSetOf() override fun lower(irFile: IrFile) { - IrInlineReferenceLocator.scan(context, irFile).let { - inlinableReferences.addAll(it.inlineReferences) - } + inlinableReferences.addAll(IrInlineReferenceLocator.scan(context, irFile)) irFile.transformChildrenVoid(this) } diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt index ca7f9b58c9a..a56402dd15f 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/SyntheticAccessorLowering.kt @@ -41,11 +41,18 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.utils.addToStdlib.safeAs internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrElementTransformerVoidWithContext(), FileLoweringPass { + data class LambdaCallSite(val scope: IrDeclaration, val crossinline: Boolean) + private val pendingAccessorsToAdd = mutableListOf() - private val inlineLambdaToCallSite = mutableMapOf() + private val inlineLambdaToCallSite = mutableMapOf() override fun lower(irFile: IrFile) { - inlineLambdaToCallSite.putAll(IrInlineReferenceLocator.scan(context, irFile).lambdaToCallSite) + irFile.accept(object : IrInlineReferenceLocator(context) { + override fun visitInlineLambda(argument: IrFunctionReference, callee: IrFunction, parameter: IrValueParameter, scope: IrDeclaration) { + inlineLambdaToCallSite[argument.symbol.owner] = LambdaCallSite(scope, parameter.isCrossinline) + } + }, null) + irFile.transformChildrenVoid(this) for (accessor in pendingAccessorsToAdd) { @@ -509,16 +516,18 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle this == JavaVisibilities.PROTECTED_AND_PACKAGE || this == JavaVisibilities.PROTECTED_STATIC_VISIBILITY - private fun IrDeclaration.getAccessContext(withSuper: Boolean): IrDeclarationContainer? = when { + private fun IrDeclaration.getAccessContext(allowSamePackage: Boolean): IrDeclarationContainer? = when { this is IrDeclarationContainer -> this - // For inline lambdas, we can navigate to the only call site directly. - this in inlineLambdaToCallSite -> inlineLambdaToCallSite[this]?.getAccessContext(withSuper) + // For inline lambdas, we can navigate to the only call site directly. Crossinline lambdas might be inlined + // into other classes in the same package, so private/super require accessors anyway. + this in inlineLambdaToCallSite -> + inlineLambdaToCallSite[this]!!.takeIf { allowSamePackage || !it.crossinline }?.scope?.getAccessContext(allowSamePackage) // Accesses from inline functions can actually be anywhere; even private inline functions can be // inlined into a different class, e.g. a callable reference. For protected inline functions // calling methods on `super` we also need an accessor to satisfy INVOKESPECIAL constraints. // TODO scan nested classes for calls to private inline functions? this is IrFunction && isInline -> null - else -> (parent as? IrDeclaration)?.getAccessContext(withSuper) + else -> (parent as? IrDeclaration)?.getAccessContext(allowSamePackage) } private fun IrSymbol.isAccessible(withSuper: Boolean, thisObjReference: IrClassSymbol?): Boolean { @@ -547,7 +556,8 @@ internal class SyntheticAccessorLowering(val context: JvmBackendContext) : IrEle // If local variables are accessible by Kotlin rules, they also are by Java rules. val symbolDeclarationContainer = (declaration.parent as? IrDeclarationContainer) as? IrElement ?: return true - val contextDeclarationContainer = (currentScope!!.irElement as IrDeclaration).getAccessContext(withSuper) ?: return false + val contextDeclarationContainer = + (currentScope!!.irElement as IrDeclaration).getAccessContext(declaration.visibility.isProtected && !withSuper) ?: return false val samePackage = declaration.getPackageFragment()?.fqName == contextDeclarationContainer.getPackageFragment()?.fqName val fromSubclassOfReceiversClass = contextDeclarationContainer is IrClass && symbolDeclarationContainer is IrClass && diff --git a/compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackageFromCrossinline.kt b/compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackageFromCrossinline.kt new file mode 100644 index 00000000000..c02c9e17f76 --- /dev/null +++ b/compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackageFromCrossinline.kt @@ -0,0 +1,19 @@ +// FILE: protectedPack/J.java + +package protectedPack; + +public class J { + protected String foo = "OK"; +} + +// FILE: 1.kt + +package protectedPack + +inline fun foo(crossinline bar: () -> String) = object { + fun baz() = bar() +}.baz() + +fun box(): String { + return foo { J().foo!! } +} diff --git a/compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt b/compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt new file mode 100644 index 00000000000..f2baf76101f --- /dev/null +++ b/compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt @@ -0,0 +1,31 @@ +// !LANGUAGE: -ProhibitProtectedCallFromInline +// IGNORE_BACKEND: JVM +// IGNORE_BACKEND_MULTI_MODULE: JVM +// FILE: 1.kt + +package test + +inline fun runCrossinline(crossinline f: () -> String) = f() + +open class Base { + protected open val FOO = "O" + + protected open fun test() = "K" +} + +open class P : Base() { + inline fun protectedProp(crossinline f: (String) -> String): String = + runCrossinline { f(FOO) } + + inline fun protectedFun(crossinline f: (String) -> String): String = + runCrossinline { f(test()) } +} + +// FILE: 2.kt + +import test.* + +fun box() : String { + val p = P() + return p.protectedProp { it } + p.protectedFun { it } +} diff --git a/compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt b/compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt new file mode 100644 index 00000000000..1ce80fc8568 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt @@ -0,0 +1,17 @@ +package a + +open class A { + protected fun protectedFun(): String = "OK" +} + +inline fun foo(crossinline bar: () -> String) = object { + fun baz() = bar() +}.baz() + +class BSamePackage: A() { + fun test(): String = foo { + protectedFun() + } +} + +// 0 INVOKESTATIC a/BSamePackage.access diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java index 34882787877..21c11a6ab3e 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxAgainstJavaCodegenTestGenerated.java @@ -1147,6 +1147,11 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAga runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackage.kt"); } + @TestMetadata("protectedPropertyInPackageFromCrossinline.kt") + public void testProtectedPropertyInPackageFromCrossinline() throws Exception { + runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackageFromCrossinline.kt"); + } + @TestMetadata("protectedStaticClass.kt") public void testProtectedStaticClass() throws Exception { runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedStaticClass.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index 7ef1b838f2f..2ef2ef83475 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -4320,6 +4320,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/privateInCrossInline.kt"); } + @TestMetadata("protectedMembersFromSuper.kt") + public void testProtectedMembersFromSuper() throws Exception { + runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt"); + } + @TestMetadata("superCall.kt") public void testSuperCall() throws Exception { runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/superCall.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 5ed3360e88d..b6f37eff3a3 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -254,6 +254,11 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/maxStackAfterOptimizations.kt"); } + @TestMetadata("noAccessorForProtectedInSamePackageCrossinline.kt") + public void testNoAccessorForProtectedInSamePackageCrossinline() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt"); + } + @TestMetadata("noFlagAnnotations.kt") public void testNoFlagAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noFlagAnnotations.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index cc94277b152..06e2c787810 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -4320,6 +4320,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/privateInCrossInline.kt"); } + @TestMetadata("protectedMembersFromSuper.kt") + public void testProtectedMembersFromSuper() throws Exception { + runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt"); + } + @TestMetadata("superCall.kt") public void testSuperCall() throws Exception { runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/superCall.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java index 49fe75582c2..7246fa12cba 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxAgainstJavaCodegenTestGenerated.java @@ -1148,6 +1148,11 @@ public class IrBlackBoxAgainstJavaCodegenTestGenerated extends AbstractIrBlackBo runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackage.kt"); } + @TestMetadata("protectedPropertyInPackageFromCrossinline.kt") + public void testProtectedPropertyInPackageFromCrossinline() throws Exception { + runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedPropertyInPackageFromCrossinline.kt"); + } + @TestMetadata("protectedStaticClass.kt") public void testProtectedStaticClass() throws Exception { runTest("compiler/testData/codegen/boxAgainstJava/visibility/protectedAndPackage/protectedStaticClass.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 959fa904474..612e582bab8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -4070,6 +4070,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/privateInCrossInline.kt"); } + @TestMetadata("protectedMembersFromSuper.kt") + public void testProtectedMembersFromSuper() throws Exception { + runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt"); + } + @TestMetadata("superCall.kt") public void testSuperCall() throws Exception { runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/superCall.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index 017455c249d..ab04c051d44 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -254,6 +254,11 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { runTest("compiler/testData/codegen/bytecodeText/maxStackAfterOptimizations.kt"); } + @TestMetadata("noAccessorForProtectedInSamePackageCrossinline.kt") + public void testNoAccessorForProtectedInSamePackageCrossinline() throws Exception { + runTest("compiler/testData/codegen/bytecodeText/noAccessorForProtectedInSamePackageCrossinline.kt"); + } + @TestMetadata("noFlagAnnotations.kt") public void testNoFlagAnnotations() throws Exception { runTest("compiler/testData/codegen/bytecodeText/noFlagAnnotations.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index a52444e35e0..fbced8d3687 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -4070,6 +4070,11 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/privateInCrossInline.kt"); } + @TestMetadata("protectedMembersFromSuper.kt") + public void testProtectedMembersFromSuper() throws Exception { + runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/protectedMembersFromSuper.kt"); + } + @TestMetadata("superCall.kt") public void testSuperCall() throws Exception { runTest("compiler/testData/codegen/boxInline/syntheticAccessors/withinInlineLambda/superCall.kt");