From a5e59e09ee4ec736ca5f72419bf31b08f1c96b87 Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Tue, 17 Aug 2021 12:22:05 +0200 Subject: [PATCH] Copy methods for lambdas to DefaultImpls without receiver transformation #KT-48230 Fixed --- .../FirBlackBoxInlineCodegenTestGenerated.java | 6 ++++++ .../backend/jvm/lower/InterfaceLowering.kt | 17 +++++++++++++---- .../psi2ir/generators/FunctionGenerator.kt | 8 ++++++-- .../psi2ir/generators/LocalFunctionGenerator.kt | 3 ++- .../ir/declarations/IrDeclarationOrigin.kt | 1 + .../box/fir/noSymbolForIntRangeIterator.txt | 2 +- .../codegen/boxInline/capture/kt48230_2.kt | 14 ++++++++++++++ .../classes/clashingFakeOverrideSignatures.txt | 2 +- .../ir/irText/declarations/defaultArguments.txt | 2 +- .../irText/declarations/parameters/lambdas.txt | 2 +- .../irText/declarations/parameters/localFun.txt | 8 ++++---- .../testData/ir/irText/expressions/kt47245.txt | 2 +- .../variableAsFunctionCallWithGenerics.txt | 2 +- .../ir/irText/lambdas/anonymousFunction.txt | 2 +- .../ir/irText/lambdas/localFunction.txt | 2 +- .../BlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...eKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../IrBlackBoxInlineCodegenTestGenerated.java | 6 ++++++ ...eKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ ...eKotlinAgainstInlineKotlinTestGenerated.java | 6 ++++++ .../JvmIrAgainstOldBoxInlineTestGenerated.java | 6 ++++++ .../JvmOldAgainstIrBoxInlineTestGenerated.java | 6 ++++++ .../IrJsCodegenInlineES6TestGenerated.java | 5 +++++ .../IrJsCodegenInlineTestGenerated.java | 5 +++++ .../semantics/JsCodegenInlineTestGenerated.java | 5 +++++ 25 files changed, 111 insertions(+), 19 deletions(-) create mode 100644 compiler/testData/codegen/boxInline/capture/kt48230_2.kt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java index c96a375b915..ebee4c096a8 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxInlineCodegenTestGenerated.java @@ -1324,6 +1324,12 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt index c91d7e6a82a..bd5e9cba306 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/InterfaceLowering.kt @@ -39,6 +39,7 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTransformerVoid(), ClassLoweringPass { private val removedFunctions = hashMapOf() + private val removedFunctionsWithoutRemapping = mutableSetOf() override fun lower(irClass: IrClass) { if (!irClass.isJvmInterface) return @@ -50,7 +51,7 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran } irClass.declarations.removeAll { - it is IrFunction && removedFunctions.containsKey(it.symbol) + it is IrFunction && (removedFunctions.containsKey(it.symbol) || removedFunctionsWithoutRemapping.contains(it.symbol)) } val defaultImplsIrClass = context.cachedDeclarations.getDefaultImplsClass(irClass) @@ -131,9 +132,17 @@ internal class InterfaceLowering(val context: JvmBackendContext) : IrElementTran (function.origin == JvmLoweredDeclarationOrigin.SYNTHETIC_METHOD_FOR_PROPERTY_OR_TYPEALIAS_ANNOTATIONS && (isCompatibilityMode || jvmDefaultMode == JvmDefaultMode.ENABLE) && function.isCompiledToJvmDefault(jvmDefaultMode)) -> { - val defaultImpl = createDefaultImpl(function) - defaultImpl.body = function.moveBodyTo(defaultImpl) - removedFunctions[function.symbol] = defaultImpl.symbol + if (function.origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA || function.origin == IrDeclarationOrigin.LOCAL_FUNCTION) { + //move as is + val defaultImplsClass = context.cachedDeclarations.getDefaultImplsClass(irClass) + defaultImplsClass.declarations.add(function) + removedFunctionsWithoutRemapping.add(function.symbol) + function.parent = defaultImplsClass + } else { + val defaultImpl = createDefaultImpl(function) + defaultImpl.body = function.moveBodyTo(defaultImpl) + removedFunctions[function.symbol] = defaultImpl.symbol + } } /** diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt index 891f522f13e..b3bf39aeaef 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/FunctionGenerator.kt @@ -39,11 +39,15 @@ class FunctionGenerator(declarationGenerator: DeclarationGenerator) : Declaratio constructor(context: GeneratorContext) : this(DeclarationGenerator(context)) - fun generateFunctionDeclaration(ktFunction: KtNamedFunction): IrSimpleFunction = + @JvmOverloads + fun generateFunctionDeclaration( + ktFunction: KtNamedFunction, + origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED + ): IrSimpleFunction = declareSimpleFunction( ktFunction, ktFunction.receiverTypeReference, - IrDeclarationOrigin.DEFINED, + origin, getOrFail(BindingContext.FUNCTION, ktFunction) ) { ktFunction.bodyExpression?.let { generateFunctionBody(it) } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt index 0711cb889d6..566d8a3f7da 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/LocalFunctionGenerator.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.psi2ir.generators import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionExpressionImpl import org.jetbrains.kotlin.psi.KtLambdaExpression @@ -53,5 +54,5 @@ class LocalFunctionGenerator(statementGenerator: StatementGenerator) : Statement } private fun generateFunctionDeclaration(ktFun: KtNamedFunction) = - FunctionGenerator(context).generateFunctionDeclaration(ktFun) + FunctionGenerator(context).generateFunctionDeclaration(ktFun, IrDeclarationOrigin.LOCAL_FUNCTION) } \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt index 4f897356a01..c9c50a86a39 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclarationOrigin.kt @@ -49,6 +49,7 @@ interface IrDeclarationOrigin { object SCRIPT_RESULT_PROPERTY : IrDeclarationOriginImpl("SCRIPT_RESULT_PROPERTY") object GENERATED_DATA_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_DATA_CLASS_MEMBER") object GENERATED_INLINE_CLASS_MEMBER : IrDeclarationOriginImpl("GENERATED_INLINE_CLASS_MEMBER") + object LOCAL_FUNCTION : IrDeclarationOriginImpl("LOCAL_FUNCTION") object LOCAL_FUNCTION_FOR_LAMBDA : IrDeclarationOriginImpl("LOCAL_FUNCTION_FOR_LAMBDA") object CATCH_PARAMETER : IrDeclarationOriginImpl("CATCH_PARAMETER") object INSTANCE_RECEIVER : IrDeclarationOriginImpl("INSTANCE_RECEIVER") diff --git a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.txt b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.txt index 80a01e2f9df..542f328aa7f 100644 --- a/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.txt +++ b/compiler/testData/codegen/box/fir/noSymbolForIntRangeIterator.txt @@ -50,7 +50,7 @@ FILE fqName: fileName:/noSymbolForIntRangeIterator.kt CONST Int type=kotlin.Int value=10 VAR name:y type:kotlin.Int [val] CONST Int type=kotlin.Int value=10 - FUN name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:localFunc visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.IntIterator [val] diff --git a/compiler/testData/codegen/boxInline/capture/kt48230_2.kt b/compiler/testData/codegen/boxInline/capture/kt48230_2.kt new file mode 100644 index 00000000000..0d6433423b8 --- /dev/null +++ b/compiler/testData/codegen/boxInline/capture/kt48230_2.kt @@ -0,0 +1,14 @@ +// NO_CHECK_LAMBDA_INLINING +// FILE: 1.kt +inline fun withO(block: String.() -> String) = "O".block() + +// FILE: 2.kt +interface I { + val k: String + + fun foo() = withO(fun String.(): String { return this + k }) +} + +fun box(): String = object : I { + override val k = "K" +}.foo() diff --git a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt index fe321ad1376..bcadd32caf1 100644 --- a/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt +++ b/compiler/testData/ir/irText/classes/clashingFakeOverrideSignatures.txt @@ -366,7 +366,7 @@ FILE fqName: fileName:/clashingFakeOverrideSignatures.kt overridden: public open fun toString (): kotlin.String [fake_override] declared in .outerFun.LocalDerived $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:local modality:FINAL <> (b:.outerFun.LocalBase, d:.outerFun.LocalDerived, d2:.outerFun.LocalDerived2) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:test visibility:local modality:FINAL <> (b:.outerFun.LocalBase, d:.outerFun.LocalDerived, d2:.outerFun.LocalDerived2) returnType:kotlin.Unit VALUE_PARAMETER name:b index:0 type:.outerFun.LocalBase VALUE_PARAMETER name:d index:1 type:.outerFun.LocalDerived VALUE_PARAMETER name:d2 index:2 type:.outerFun.LocalDerived2 diff --git a/compiler/testData/ir/irText/declarations/defaultArguments.txt b/compiler/testData/ir/irText/declarations/defaultArguments.txt index caa2c74f688..a3784170663 100644 --- a/compiler/testData/ir/irText/declarations/defaultArguments.txt +++ b/compiler/testData/ir/irText/declarations/defaultArguments.txt @@ -8,7 +8,7 @@ FILE fqName: fileName:/defaultArguments.kt EXPRESSION_BODY CONST String type=kotlin.String value="abc" BLOCK_BODY - FUN name:local visibility:local modality:FINAL <> (xx:kotlin.Int, yy:kotlin.Int, zz:kotlin.String) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:local visibility:local modality:FINAL <> (xx:kotlin.Int, yy:kotlin.Int, zz:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:xx index:0 type:kotlin.Int EXPRESSION_BODY GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/parameters/lambdas.txt b/compiler/testData/ir/irText/declarations/parameters/lambdas.txt index a79f92d3c68..ff8375afae0 100644 --- a/compiler/testData/ir/irText/declarations/parameters/lambdas.txt +++ b/compiler/testData/ir/irText/declarations/parameters/lambdas.txt @@ -48,7 +48,7 @@ FILE fqName: fileName:/lambdas.kt FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Function2 visibility:private [final,static] EXPRESSION_BODY FUN_EXPR type=kotlin.Function2 origin=ANONYMOUS_FUNCTION - FUN name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name: visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.Int) returnType:kotlin.Unit VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/parameters/localFun.txt b/compiler/testData/ir/irText/declarations/parameters/localFun.txt index b2ab863a5b3..0366931ad77 100644 --- a/compiler/testData/ir/irText/declarations/parameters/localFun.txt +++ b/compiler/testData/ir/irText/declarations/parameters/localFun.txt @@ -2,12 +2,12 @@ FILE fqName: fileName:/localFun.kt FUN name:outer visibility:public modality:FINAL () returnType:kotlin.Unit TYPE_PARAMETER name:TT index:0 variance: superTypes:[kotlin.Any?] BLOCK_BODY - FUN name:test1 visibility:local modality:FINAL (i:kotlin.Int, j:T of .outer.test1) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:test1 visibility:local modality:FINAL (i:kotlin.Int, j:T of .outer.test1) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:T of .outer.test1 BLOCK_BODY - FUN name:test2 visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:test2 visibility:local modality:FINAL <> (i:kotlin.Int, j:kotlin.String) returnType:kotlin.Unit VALUE_PARAMETER name:i index:0 type:kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value=0 @@ -15,10 +15,10 @@ FILE fqName: fileName:/localFun.kt EXPRESSION_BODY CONST String type=kotlin.String value="" BLOCK_BODY - FUN name:test3 visibility:local modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:test3 visibility:local modality:FINAL <> (args:kotlin.Array) returnType:kotlin.Unit VALUE_PARAMETER name:args index:0 type:kotlin.Array varargElementType:kotlin.String [vararg] BLOCK_BODY - FUN name:textExt1 visibility:local modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:TT of .outer) returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:textExt1 visibility:local modality:FINAL <> ($receiver:kotlin.String, i:kotlin.Int, j:TT of .outer) returnType:kotlin.Unit $receiver: VALUE_PARAMETER name: type:kotlin.String VALUE_PARAMETER name:i index:0 type:kotlin.Int VALUE_PARAMETER name:j index:1 type:TT of .outer diff --git a/compiler/testData/ir/irText/expressions/kt47245.txt b/compiler/testData/ir/irText/expressions/kt47245.txt index d964b6470c3..db328d49ec0 100644 --- a/compiler/testData/ir/irText/expressions/kt47245.txt +++ b/compiler/testData/ir/irText/expressions/kt47245.txt @@ -15,5 +15,5 @@ FILE fqName: fileName:/kt47245.kt CALL 'public final fun next (): kotlin.Int [operator] declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.IntIterator [val] declared in .test' type=kotlin.collections.IntIterator origin=null BLOCK type=kotlin.Unit origin=null - FUN name:x visibility:local modality:FINAL <> () returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:x visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.txt index d9b094c7175..2c631f0a2f6 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.txt @@ -27,7 +27,7 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0.> declared in ' FUN_EXPR type=kotlin.Function0.> origin=ANONYMOUS_FUNCTION - FUN name: visibility:local modality:FINAL <> () returnType:T of . + FUN LOCAL_FUNCTION name: visibility:local modality:FINAL <> () returnType:T of . BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): T of . declared in .' GET_VAR ': T of . declared in .' type=T of . origin=null diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt index e74f95f7e7f..c0f8107aac0 100644 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt @@ -3,7 +3,7 @@ FILE fqName: fileName:/anonymousFunction.kt FIELD PROPERTY_BACKING_FIELD name:anonymous type:kotlin.Function0 visibility:private [final,static] EXPRESSION_BODY FUN_EXPR type=kotlin.Function0 origin=ANONYMOUS_FUNCTION - FUN name: visibility:local modality:FINAL <> () returnType:kotlin.Unit + FUN LOCAL_FUNCTION name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun println (): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Function0 diff --git a/compiler/testData/ir/irText/lambdas/localFunction.txt b/compiler/testData/ir/irText/lambdas/localFunction.txt index 7b2fbd1ba99..f9aad287a56 100644 --- a/compiler/testData/ir/irText/lambdas/localFunction.txt +++ b/compiler/testData/ir/irText/lambdas/localFunction.txt @@ -3,7 +3,7 @@ FILE fqName: fileName:/localFunction.kt BLOCK_BODY VAR name:x type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 - FUN name:local visibility:local modality:FINAL <> () returnType:kotlin.Unit + FUN LOCAL_FUNCTION name:local visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit BLOCK type=kotlin.Int origin=POSTFIX_INCR diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java index e36251cc2d3..b930ab09f1a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -1312,6 +1312,12 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index 031d2ee5915..3dea15220cb 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1312,6 +1312,12 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java index f70e6ea7bef..27f3dd2a8fe 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxInlineCodegenTestGenerated.java @@ -1324,6 +1324,12 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java index ef16c70073d..71e231a6435 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1324,6 +1324,12 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java index cfa9a67a00c..837695b52c6 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated.java @@ -1324,6 +1324,12 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java index 04e9119dcd7..721fa611c23 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmIrAgainstOldBoxInlineTestGenerated.java @@ -1324,6 +1324,12 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java index 512b572bfb5..06a234f22d2 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/JvmOldAgainstIrBoxInlineTestGenerated.java @@ -1312,6 +1312,12 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @Test + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @Test @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java index f0eca47cff0..deb5bbd01ac 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenInlineES6TestGenerated.java @@ -1007,6 +1007,11 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { runTest("compiler/testData/codegen/boxInline/capture/simpleCapturingInClass.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java index 498e124796e..28e158c6675 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenInlineTestGenerated.java @@ -1007,6 +1007,11 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { runTest("compiler/testData/codegen/boxInline/capture/simpleCapturingInClass.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java index 369d771da87..f6166bd639f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenInlineTestGenerated.java @@ -1007,6 +1007,11 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest { runTest("compiler/testData/codegen/boxInline/capture/kt48230.kt"); } + @TestMetadata("kt48230_2.kt") + public void testKt48230_2() throws Exception { + runTest("compiler/testData/codegen/boxInline/capture/kt48230_2.kt"); + } + @TestMetadata("simpleCapturingInClass.kt") public void testSimpleCapturingInClass() throws Exception { runTest("compiler/testData/codegen/boxInline/capture/simpleCapturingInClass.kt");