diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index 2d871a211f1..a83caf4062e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -1962,7 +1962,7 @@ public class ExpressionCodegen extends JetVisitor implem DeclarationDescriptor enumClass = classDescriptor.getContainingDeclaration(); assert DescriptorUtils.isEnumClass(enumClass) : "Enum entry should be declared in enum class: " + descriptor; Type type = typeMapper.mapType((ClassDescriptor) enumClass); - return StackValue.field(type, type, descriptor.getName().asString(), true, StackValue.none()); + return StackValue.field(type, type, descriptor.getName().asString(), true, StackValue.none(), classDescriptor); } ClassDescriptor companionObjectDescriptor = classDescriptor.getCompanionObjectDescriptor(); if (companionObjectDescriptor != null) { @@ -1983,7 +1983,7 @@ public class ExpressionCodegen extends JetVisitor implem ClassDescriptor scriptClass = bindingContext.get(CLASS_FOR_SCRIPT, scriptDescriptor); StackValue script = StackValue.thisOrOuter(this, scriptClass, false, false); Type fieldType = typeMapper.mapType(valueParameterDescriptor); - return StackValue.field(fieldType, scriptClassType, valueParameterDescriptor.getName().getIdentifier(), false, script); + return StackValue.field(fieldType, scriptClassType, valueParameterDescriptor.getName().getIdentifier(), false, script, valueParameterDescriptor); } throw new UnsupportedOperationException("don't know how to generate reference " + descriptor); @@ -2490,15 +2490,16 @@ public class ExpressionCodegen extends JetVisitor implem if (cur instanceof ScriptContext) { ScriptContext scriptContext = (ScriptContext) cur; - if (scriptContext.getScriptDescriptor() == receiver.getDeclarationDescriptor()) { + ScriptDescriptor receiverDeclarationDescriptor = receiver.getDeclarationDescriptor(); + if (scriptContext.getScriptDescriptor() == receiverDeclarationDescriptor) { //TODO lazy return result; } else { Type currentScriptType = asmTypeForScriptDescriptor(bindingContext, scriptContext.getScriptDescriptor()); - Type classType = asmTypeForScriptDescriptor(bindingContext, receiver.getDeclarationDescriptor()); - String fieldName = scriptContext.getScriptFieldName(receiver.getDeclarationDescriptor()); - return StackValue.field(classType, currentScriptType, fieldName, false, result); + Type classType = asmTypeForScriptDescriptor(bindingContext, receiverDeclarationDescriptor); + String fieldName = scriptContext.getScriptFieldName(receiverDeclarationDescriptor); + return StackValue.field(classType, currentScriptType, fieldName, false, result, receiverDeclarationDescriptor); } } @@ -3440,7 +3441,7 @@ public class ExpressionCodegen extends JetVisitor implem JetScript scriptPsi = JetPsiUtil.getScript(variableDeclaration); assert scriptPsi != null; Type scriptClassType = asmTypeForScriptPsi(bindingContext, scriptPsi); - storeTo = StackValue.field(varType, scriptClassType, variableDeclaration.getName(), false, StackValue.LOCAL_0); + storeTo = StackValue.field(varType, scriptClassType, variableDeclaration.getName(), false, StackValue.LOCAL_0, variableDescriptor); } else if (sharedVarType == null) { storeTo = StackValue.local(index, varType); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index 64a3cd7d6d8..f1a4d325713 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -1043,7 +1043,8 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { private void copyFieldFromCompanionObject(PropertyDescriptor propertyDescriptor) { ExpressionCodegen codegen = createOrGetClInitCodegen(); StackValue property = codegen.intermediateValueForProperty(propertyDescriptor, false, null, StackValue.none()); - StackValue.Field field = StackValue.field(property.type, classAsmType, propertyDescriptor.getName().asString(), true, StackValue.none()); + StackValue.Field field = StackValue + .field(property.type, classAsmType, propertyDescriptor.getName().asString(), true, StackValue.none(), propertyDescriptor); field.store(property, codegen.v); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java index 3e22b1d2abb..6c0e8e664a2 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/StackValue.java @@ -206,12 +206,24 @@ public abstract class StackValue { @NotNull public static Field field(@NotNull Type type, @NotNull Type owner, @NotNull String name, boolean isStatic, @NotNull StackValue receiver) { - return new Field(type, owner, name, isStatic, receiver); + return field(type, owner, name, isStatic, receiver, null); + } + + @NotNull + public static Field field( + @NotNull Type type, + @NotNull Type owner, + @NotNull String name, + boolean isStatic, + @NotNull StackValue receiver, + @Nullable DeclarationDescriptor descriptor + ) { + return new Field(type, owner, name, isStatic, receiver, descriptor); } @NotNull public static Field field(@NotNull StackValue.Field field, @NotNull StackValue newReceiver) { - return new Field(field.type, field.owner, field.name, field.isStaticPut, newReceiver); + return field(field.type, field.owner, field.name, field.isStaticPut, newReceiver, field.descriptor); } @NotNull @@ -402,8 +414,14 @@ public abstract class StackValue { return None.INSTANCE; } - public static FieldForSharedVar fieldForSharedVar(@NotNull Type localType, @NotNull Type classType, @NotNull String fieldName, @NotNull StackValue receiver) { - Field receiverWithRefWrapper = field(sharedTypeForType(localType), classType, fieldName, false, receiver); + public static FieldForSharedVar fieldForSharedVar( + @NotNull Type localType, + @NotNull Type classType, + @NotNull String fieldName, + @NotNull StackValue receiver, + @Nullable DeclarationDescriptor descriptor + ) { + Field receiverWithRefWrapper = field(sharedTypeForType(localType), classType, fieldName, false, receiver, descriptor); return new FieldForSharedVar(localType, classType, fieldName, receiverWithRefWrapper); } @@ -986,11 +1004,20 @@ public abstract class StackValue { public static class Field extends StackValueWithSimpleReceiver { public final Type owner; public final String name; + public final DeclarationDescriptor descriptor; - public Field(Type type, Type owner, String name, boolean isStatic, StackValue receiver) { + public Field( + @NotNull Type type, + @NotNull Type owner, + @NotNull String name, + boolean isStatic, + @NotNull StackValue receiver, + @Nullable DeclarationDescriptor descriptor + ) { super(type, isStatic, isStatic, receiver, receiver.canHaveSideEffects()); this.owner = owner; this.name = name; + this.descriptor = descriptor; } @Override diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/ClassContext.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/ClassContext.java index d430d43f188..050a2b4da9b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/ClassContext.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/ClassContext.java @@ -56,7 +56,8 @@ public class ClassContext extends FieldOwnerContext { typeMapper.mapType(getContextDescriptor()), CAPTURED_THIS_FIELD, /* isStatic = */ false, - StackValue.LOCAL_0 + StackValue.LOCAL_0, + enclosingClass ); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/LocalLookup.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/LocalLookup.java index e555b630c94..eba8b060b5e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/context/LocalLookup.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/context/LocalLookup.java @@ -62,8 +62,8 @@ public interface LocalLookup { String fieldName = "$" + vd.getName(); StackValue.Local thiz = StackValue.LOCAL_0; StackValue.StackValueWithSimpleReceiver innerValue = sharedVarType != null - ? StackValue.fieldForSharedVar(localType, classType, fieldName, thiz) - : StackValue.field(type, classType, fieldName, false, thiz); + ? StackValue.fieldForSharedVar(localType, classType, fieldName, thiz, vd) + : StackValue.field(type, classType, fieldName, false, thiz, vd); closure.recordField(fieldName, type); closure.captureVariable(new EnclosedValueDescriptor(fieldName, d, innerValue, type)); @@ -98,12 +98,12 @@ public interface LocalLookup { if (localFunClosure != null && JvmCodegenUtil.isConst(localFunClosure)) { // This is an optimization: we can obtain an instance of a const closure simply by GETSTATIC ...$instance // (instead of passing this instance to the constructor and storing as a field) - return StackValue.field(localType, localType, JvmAbi.INSTANCE_FIELD, true, StackValue.LOCAL_0); + return StackValue.field(localType, localType, JvmAbi.INSTANCE_FIELD, true, StackValue.LOCAL_0, vd); } String fieldName = "$" + vd.getName(); StackValue.StackValueWithSimpleReceiver innerValue = StackValue.field(localType, classType, fieldName, false, - StackValue.LOCAL_0); + StackValue.LOCAL_0, vd); closure.recordField(fieldName, localType); closure.captureVariable(new EnclosedValueDescriptor(fieldName, d, innerValue, localType)); @@ -133,7 +133,7 @@ public interface LocalLookup { JetType receiverType = closure.getEnclosingReceiverDescriptor().getType(); Type type = state.getTypeMapper().mapType(receiverType); StackValue.StackValueWithSimpleReceiver innerValue = StackValue.field(type, classType, CAPTURED_RECEIVER_FIELD, false, - StackValue.LOCAL_0); + StackValue.LOCAL_0, d); closure.setCaptureReceiver(); return innerValue; diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java index 6dbcab966e3..dc9e75bdc9a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java @@ -454,21 +454,21 @@ public class InlineCodegen extends CallGenerator { return false; } - //skip direct capturing fields - StackValue receiver = null; - if (stackValue instanceof StackValue.Field) { - receiver = ((StackValue.Field) stackValue).receiver; - } - else if (stackValue instanceof StackValue.FieldForSharedVar) { - receiver = ((StackValue.Field) ((StackValue.FieldForSharedVar) stackValue).receiver).receiver; + StackValue field = stackValue; + if (stackValue instanceof StackValue.FieldForSharedVar) { + field = ((StackValue.FieldForSharedVar) stackValue).receiver; } - if (!(receiver instanceof StackValue.Local)) { - return true; + //check that value corresponds to captured inlining parameter + if (field instanceof StackValue.Field) { + DeclarationDescriptor varDescriptor = ((StackValue.Field) field).descriptor; + //check that variable is inline function parameter + return !(varDescriptor instanceof CallableDescriptor && + InlineUtil.isInlineLambdaParameter((CallableDescriptor) varDescriptor) && + InlineUtil.isInline(varDescriptor.getContainingDeclaration())); } - //TODO: check type of context - return !(codegen.getContext().isInliningLambda() && descriptor != null && !KotlinBuiltIns.isNoinline(descriptor)); + return true; } private void putParameterOnStack(ParameterInfo... infos) { diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.1.kt new file mode 100644 index 00000000000..d111b541a6d --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return bar {"OK"} () +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.2.kt new file mode 100644 index 00000000000..33234807538 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = { + call(y) +} + +public inline fun call(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.1.kt new file mode 100644 index 00000000000..d111b541a6d --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return bar {"OK"} () +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.2.kt new file mode 100644 index 00000000000..b2615ed13e4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = { + { { call(y) }() }() +} + +public inline fun call(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.1.kt new file mode 100644 index 00000000000..8100b447af6 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.1.kt @@ -0,0 +1,12 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + val bar1 = bar {"123"} () + val bar2 = bar2 { "1234" } () + return if (bar1 == "123" && bar2 == "1234") "OK" else "fail: $bar1 $bar2" +} + +inline fun bar2(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = { + { { call(y) }() }() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.2.kt new file mode 100644 index 00000000000..c3539f621ba --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = { + { { call(y) }() }() +} + +public inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) f: () -> T): T = {{ f() }()}() \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.1.kt new file mode 100644 index 00000000000..a5b838f9e35 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return bar { "OK" }.run() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.2.kt new file mode 100644 index 00000000000..a3ff909d1c5 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.2.kt @@ -0,0 +1,17 @@ +package test + +trait A { + fun run(): T; +} + +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = object : A { + override fun run() : String { + return call(y) + } +} + +public inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) f: () -> T): T = object : A { + override fun run() : T { + return f() + } +}.run() \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/reified/capturedLambda.1.kt b/compiler/testData/codegen/boxInline/reified/capturedLambda.1.kt new file mode 100644 index 00000000000..8af5a7c91a6 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/capturedLambda.1.kt @@ -0,0 +1,8 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +val x: () -> String = foo() + +fun box(): String { + return x() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/reified/capturedLambda.2.kt b/compiler/testData/codegen/boxInline/reified/capturedLambda.2.kt new file mode 100644 index 00000000000..d6d1592d76a --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/capturedLambda.2.kt @@ -0,0 +1,9 @@ +package test + +inline fun foo() = bar() {"OK"} +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) y: () -> String) = { + null is E + run(y) +} + +public inline fun call(f: () -> T): T = f() \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/reified/capturedLambda2.1.kt b/compiler/testData/codegen/boxInline/reified/capturedLambda2.1.kt new file mode 100644 index 00000000000..52717715da2 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/capturedLambda2.1.kt @@ -0,0 +1,8 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +inline fun foo() = bar() {"OK"} + +fun box(): String { + return foo()() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/reified/capturedLambda2.2.kt b/compiler/testData/codegen/boxInline/reified/capturedLambda2.2.kt new file mode 100644 index 00000000000..df5bcadff81 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/capturedLambda2.2.kt @@ -0,0 +1,9 @@ +package test + +inline fun bar(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) tasksFactory: () -> T) = { + null is R + run(tasksFactory) +} + +public inline fun call(f: () -> T): T = f() + diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index cb00dfe0459..220e5743a72 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -66,6 +66,30 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSiteSuperParams.1.kt"); doTestMultiFileWithInlineCheck(fileName); } + + @TestMetadata("capturedLambdaInInline.1.kt") + public void testCapturedLambdaInInline() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInline2.1.kt") + public void testCapturedLambdaInInline2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInline3.1.kt") + public void testCapturedLambdaInInline3() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInlineObject.1.kt") + public void testCapturedLambdaInInlineObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/builders") @@ -688,6 +712,18 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/reified"), Pattern.compile("^(.+)\\.1.kt$"), true); } + @TestMetadata("capturedLambda.1.kt") + public void testCapturedLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/capturedLambda.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambda2.1.kt") + public void testCapturedLambda2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/capturedLambda2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + @TestMetadata("packages.1.kt") public void testPackages() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/packages.1.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index cb7e04c4de2..7bcbabd15d6 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -66,6 +66,30 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/anonymousObjectOnDeclarationSiteSuperParams.1.kt"); doBoxTestWithInlineCheck(fileName); } + + @TestMetadata("capturedLambdaInInline.1.kt") + public void testCapturedLambdaInInline() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInline2.1.kt") + public void testCapturedLambdaInInline2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInline3.1.kt") + public void testCapturedLambdaInInline3() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInline3.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambdaInInlineObject.1.kt") + public void testCapturedLambdaInInlineObject() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/capturedLambdaInInlineObject.1.kt"); + doBoxTestWithInlineCheck(fileName); + } } @TestMetadata("compiler/testData/codegen/boxInline/builders") @@ -688,6 +712,18 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/reified"), Pattern.compile("^(.+)\\.1.kt$"), true); } + @TestMetadata("capturedLambda.1.kt") + public void testCapturedLambda() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/capturedLambda.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("capturedLambda2.1.kt") + public void testCapturedLambda2() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/capturedLambda2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + @TestMetadata("packages.1.kt") public void testPackages() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/reified/packages.1.kt");