From d4369c1df9f421c75087ed262cfd30b6411b931e Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Wed, 18 Nov 2015 11:56:33 +0300 Subject: [PATCH] Keep inline transformation invariant: all captured parameters stored in topmost lambda/object Fix for KT-8668: java.lang.ClassFormatError: Duplicate field name&signature (based on property access) #KT-8668 Fixed --- .../inline/AnonymousObjectTransformer.java | 50 ++++-- .../kotlin/codegen/inline/FieldRemapper.java | 5 + .../codegen/inline/InlineCodegenUtil.java | 2 + .../codegen/inline/InlinedLambdaRemapper.java | 12 ++ .../RegeneratedLambdaFieldRemapper.java | 21 ++- .../properRecapturing/inlineChain.1.kt | 7 + .../properRecapturing/inlineChain.2.kt | 18 ++ .../properRecapturing/lambdaChain.1.kt | 19 ++ .../properRecapturing/lambdaChain.2.kt | 5 + .../properRecapturing/lambdaChainSimple.1.kt | 15 ++ .../properRecapturing/lambdaChainSimple.2.kt | 7 + .../properRecapturing/lambdaChain_2.1.kt | 19 ++ .../properRecapturing/lambdaChain_2.2.kt | 7 + .../properRecapturing/lambdaChain_3.1.kt | 17 ++ .../properRecapturing/lambdaChain_3.2.kt | 7 + .../properRecapturing/noInlineLambda.1.kt | 7 + .../properRecapturing/noInlineLambda.2.kt | 18 ++ .../properRecapturingInClass/inlineChain.1.kt | 7 + .../properRecapturingInClass/inlineChain.2.kt | 22 +++ .../inlinelambdaChain.1.kt | 6 + .../inlinelambdaChain.2.kt | 30 ++++ .../properRecapturingInClass/lambdaChain.1.kt | 6 + .../properRecapturingInClass/lambdaChain.2.kt | 28 +++ .../lambdaChainSimple.1.kt | 6 + .../lambdaChainSimple.2.kt | 24 +++ .../lambdaChainSimple_2.1.kt | 6 + .../lambdaChainSimple_2.2.kt | 26 +++ .../lambdaChain_2.1.kt | 6 + .../lambdaChain_2.2.kt | 29 +++ .../lambdaChain_3.1.kt | 6 + .../lambdaChain_3.2.kt | 29 +++ .../noCapturedThisOnCallSite.1.kt | 7 + .../noCapturedThisOnCallSite.2.kt | 21 +++ .../noInlineLambda.1.kt | 8 + .../noInlineLambda.2.kt | 22 +++ .../twoInlineLambda.1.kt | 7 + .../twoInlineLambda.2.kt | 22 +++ .../twoInlineLambdaComplex.1.kt | 7 + .../twoInlineLambdaComplex.2.kt | 31 ++++ .../twoInlineLambdaComplex_2.1.kt | 7 + .../twoInlineLambdaComplex_2.2.kt | 32 ++++ .../twoCapturedReceivers/kt8668.1.kt | 6 + .../twoCapturedReceivers/kt8668.2.kt | 20 +++ .../twoCapturedReceivers/kt8668_2.1.kt | 6 + .../twoCapturedReceivers/kt8668_2.2.kt | 15 ++ .../twoCapturedReceivers/kt8668_3.1.kt | 9 + .../twoCapturedReceivers/kt8668_3.2.kt | 14 ++ .../twoDifferentDispatchReceivers.1.kt | 6 + .../twoDifferentDispatchReceivers.2.kt | 17 ++ .../twoExtensionReceivers.1.kt | 6 + .../twoExtensionReceivers.2.kt | 14 ++ .../BlackBoxInlineCodegenTestGenerated.java | 165 ++++++++++++++++++ ...otlinAgainstInlineKotlinTestGenerated.java | 165 ++++++++++++++++++ 53 files changed, 1056 insertions(+), 18 deletions(-) create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.2.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt create mode 100644 compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.2.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/AnonymousObjectTransformer.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/AnonymousObjectTransformer.java index 23e9bbf95ee..e73a1aec5fd 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/AnonymousObjectTransformer.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/AnonymousObjectTransformer.java @@ -179,7 +179,7 @@ public class AnonymousObjectTransformer { ParametersBuilder constructorParamBuilder = ParametersBuilder.newBuilder(); List additionalFakeParams = extractParametersMappingAndPatchConstructor(constructor, allCapturedParamBuilder, constructorParamBuilder, - anonymousObjectGen); + anonymousObjectGen, parentRemapper); List deferringMethods = new ArrayList(); for (MethodNode next : methodsToTransform) { @@ -378,7 +378,8 @@ public class AnonymousObjectTransformer { @NotNull MethodNode constructor, @NotNull ParametersBuilder capturedParamBuilder, @NotNull ParametersBuilder constructorParamBuilder, - @NotNull final AnonymousObjectGeneration anonymousObjectGen + @NotNull final AnonymousObjectGeneration anonymousObjectGen, + @NotNull FieldRemapper parentFieldRemapper ) { CapturedParamOwner owner = new CapturedParamOwner() { @@ -454,22 +455,45 @@ public class AnonymousObjectTransformer { //TODO: some of such parameters could be skipped - we should perform additional analysis Map capturedLambdasToInline = new HashMap(); //captured var of inlined parameter List allRecapturedParameters = new ArrayList(); + boolean addCapturedNotAddOuter = parentFieldRemapper.isRoot() || (parentFieldRemapper instanceof InlinedLambdaRemapper && parentFieldRemapper.getParent().isRoot()); for (LambdaInfo info : capturedLambdas) { - for (CapturedParamDesc desc : info.getCapturedVars()) { - CapturedParamInfo recapturedParamInfo = capturedParamBuilder.addCapturedParam(desc, getNewFieldName(desc.getFieldName())); - StackValue composed = StackValue.field(desc.getType(), - oldObjectType, /*TODO owner type*/ - recapturedParamInfo.getNewFieldName(), - false, - StackValue.LOCAL_0); - recapturedParamInfo.setRemapValue(composed); - allRecapturedParameters.add(desc); + if (addCapturedNotAddOuter) { + for (CapturedParamDesc desc : info.getCapturedVars()) { + CapturedParamInfo recapturedParamInfo = capturedParamBuilder.addCapturedParam(desc, getNewFieldName(desc.getFieldName())); + StackValue composed = StackValue.field(desc.getType(), + oldObjectType, /*TODO owner type*/ + recapturedParamInfo.getNewFieldName(), + false, + StackValue.LOCAL_0); + recapturedParamInfo.setRemapValue(composed); + allRecapturedParameters.add(desc); - constructorParamBuilder.addCapturedParam(recapturedParamInfo, recapturedParamInfo.getNewFieldName()).setRemapValue(composed); + constructorParamBuilder.addCapturedParam(recapturedParamInfo, recapturedParamInfo.getNewFieldName()).setRemapValue(composed); + } } capturedLambdasToInline.put(info.getLambdaClassType().getInternalName(), info); } + if (parentFieldRemapper instanceof InlinedLambdaRemapper && !capturedLambdas.isEmpty() && !addCapturedNotAddOuter) { + //lambda with non InlinedLambdaRemapper already have outer + FieldRemapper parent = parentFieldRemapper.getParent(); + assert parent instanceof RegeneratedLambdaFieldRemapper; + final Type ownerType = Type.getObjectType(parent.getLambdaInternalName()); + + CapturedParamDesc desc = new CapturedParamDesc(new CapturedParamOwner() { + @Override + public Type getType() { + return ownerType; + } + }, InlineCodegenUtil.THIS, ownerType); + CapturedParamInfo recapturedParamInfo = capturedParamBuilder.addCapturedParam(desc, InlineCodegenUtil.THIS$0); + StackValue composed = StackValue.LOCAL_0; + recapturedParamInfo.setRemapValue(composed); + allRecapturedParameters.add(desc); + + constructorParamBuilder.addCapturedParam(recapturedParamInfo, recapturedParamInfo.getNewFieldName()).setRemapValue(composed); + } + anonymousObjectGen.setAllRecapturedParameters(allRecapturedParameters); @@ -484,7 +508,7 @@ public class AnonymousObjectTransformer { //"this$0" couldn't clash and we should keep this name invariant for further transformations return oldName; } - return addUniqueField(oldName + "$inlined"); + return addUniqueField(oldName + InlineCodegenUtil.INLINE_TRANSFORMATION_SUFFIX); } @NotNull diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/FieldRemapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/FieldRemapper.java index 087c3878214..886a0acc111 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/FieldRemapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/FieldRemapper.java @@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.codegen.StackValue; import org.jetbrains.org.objectweb.asm.Opcodes; +import org.jetbrains.org.objectweb.asm.Type; import org.jetbrains.org.objectweb.asm.tree.AbstractInsnNode; import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode; import org.jetbrains.org.objectweb.asm.tree.MethodNode; @@ -120,6 +121,10 @@ public class FieldRemapper { return lambdaInternalName; } + public String getNewLambdaInternalName() { + return lambdaInternalName; + } + public boolean isRoot() { return parent == null; } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegenUtil.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegenUtil.java index 4532fbec70b..ec4f58b8a8d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegenUtil.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegenUtil.java @@ -62,6 +62,7 @@ public class InlineCodegenUtil { public static final String CAPTURED_FIELD_PREFIX = "$"; public static final String THIS$0 = "this$0"; + public static final String THIS = "this"; public static final String RECEIVER$0 = "receiver$0"; public static final String NON_LOCAL_RETURN = "$$$$$NON_LOCAL_RETURN$$$$$"; public static final String FIRST_FUN_LABEL = "$$$$$ROOT$$$$$"; @@ -71,6 +72,7 @@ public class InlineCodegenUtil { public static final String INLINE_MARKER_AFTER_METHOD_NAME = "afterInlineCall"; public static final String INLINE_MARKER_FINALLY_START = "finallyStart"; public static final String INLINE_MARKER_FINALLY_END = "finallyEnd"; + public static final String INLINE_TRANSFORMATION_SUFFIX = "$inlined"; @Nullable public static SMAPAndMethodNode getMethodNode( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlinedLambdaRemapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlinedLambdaRemapper.java index 4f28c961c86..2c9df346d98 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlinedLambdaRemapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlinedLambdaRemapper.java @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.codegen.inline; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.codegen.StackValue; import org.jetbrains.org.objectweb.asm.tree.FieldInsnNode; import java.util.Collection; @@ -50,4 +51,15 @@ public class InlinedLambdaRemapper extends FieldRemapper { public boolean isInsideInliningLambda() { return true; } + + + @Nullable + @Override + public StackValue getFieldForInline(@NotNull FieldInsnNode node, @Nullable StackValue prefix) { + if (parent.isRoot()) { + return super.getFieldForInline(node, prefix); + } else { + return parent.getFieldForInline(node, prefix); + } + } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/RegeneratedLambdaFieldRemapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/RegeneratedLambdaFieldRemapper.java index caf6f789b71..23466f3c71b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/RegeneratedLambdaFieldRemapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/RegeneratedLambdaFieldRemapper.java @@ -51,11 +51,11 @@ public class RegeneratedLambdaFieldRemapper extends FieldRemapper { @Override public boolean canProcess(@NotNull String fieldOwner, String fieldName, boolean isFolding) { - return super.canProcess(fieldOwner, fieldName, isFolding) || isRecapturedLambdaType(fieldOwner); + return super.canProcess(fieldOwner, fieldName, isFolding) || isRecapturedLambdaType(fieldOwner, isFolding); } - private boolean isRecapturedLambdaType(String owner) { - return recapturedLambdas.containsKey(owner); + private boolean isRecapturedLambdaType(String owner, boolean isFolding) { + return recapturedLambdas.containsKey(owner) && (isFolding || false == parent instanceof InlinedLambdaRemapper); } @Nullable @@ -79,10 +79,20 @@ public class RegeneratedLambdaFieldRemapper extends FieldRemapper { return super.findField(fieldInsnNode, parameters.getCaptured()); } + @Override + public String getNewLambdaInternalName() { + return newOwnerType; + } + @Nullable @Override public StackValue getFieldForInline(@NotNull FieldInsnNode node, @Nullable StackValue prefix) { assert node.name.startsWith("$$$") : "Captured field template should start with $$$ prefix"; + if (node.name.equals("$$$" + InlineCodegenUtil.THIS)) { + assert oldOwnerType.equals(node.owner) : "Can't unfold '$$$THIS' parameter"; + return StackValue.LOCAL_0; + } + FieldInsnNode fin = new FieldInsnNode(node.getOpcode(), node.owner, node.name.substring(3), node.desc); CapturedParamInfo field = findFieldInMyCaptured(fin); @@ -95,8 +105,9 @@ public class RegeneratedLambdaFieldRemapper extends FieldRemapper { } } - StackValue result = StackValue.field(field.getType(), - Type.getObjectType(newOwnerType), /*TODO owner type*/ + StackValue result = StackValue.field(field.isSkipped ? + Type.getObjectType(parent.parent.getNewLambdaInternalName()) : field.getType(), + Type.getObjectType(getNewLambdaInternalName()), /*TODO owner type*/ field.getNewFieldName(), false, prefix == null ? StackValue.LOCAL_0 : prefix); diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt new file mode 100644 index 00000000000..81436d23f2c --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "fail" + test { it -> result = it } + return result +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.2.kt new file mode 100644 index 00000000000..99369524bd8 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.2.kt @@ -0,0 +1,18 @@ +package test + +interface A { + fun run() +} + +inline fun testNested(crossinline f: (String) -> Unit) { + object : A { + override fun run() { + f("OK") + } + }.run() +} + +inline fun test(crossinline f: (String) -> Unit) { + testNested { it -> { f(it) }()} +} + diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt new file mode 100644 index 00000000000..58a354f51e4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt @@ -0,0 +1,19 @@ +import test.* + +fun box(): String { + val param = "start" + var result = "fail" + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + { + result = param + c + a + }() + }() + } + }() + } + + return if (result == "start12") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.2.kt new file mode 100644 index 00000000000..dd9a104eeb4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.2.kt @@ -0,0 +1,5 @@ +package test + +inline fun inlineFun(arg: T, f: (T) -> Unit) { + f(arg) +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt new file mode 100644 index 00000000000..6aaa9700326 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt @@ -0,0 +1,15 @@ +import test.* + +fun box(): String { + val param = "start" + var result = "fail" + + inlineFun("2") { a -> + { + result = param + a + }() + } + + + return if (result == "start2") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.2.kt new file mode 100644 index 00000000000..dff81fd226e --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun inlineFun(arg: T, crossinline f: (T) -> Unit) { + { + f(arg) + }() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt new file mode 100644 index 00000000000..58a354f51e4 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt @@ -0,0 +1,19 @@ +import test.* + +fun box(): String { + val param = "start" + var result = "fail" + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + { + result = param + c + a + }() + }() + } + }() + } + + return if (result == "start12") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.2.kt new file mode 100644 index 00000000000..dff81fd226e --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun inlineFun(arg: T, crossinline f: (T) -> Unit) { + { + f(arg) + }() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt new file mode 100644 index 00000000000..383e6dbc71c --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt @@ -0,0 +1,17 @@ +import test.* + +fun box(): String { + val param = "start" + var result = "fail" + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + result = param + c + a + }() + } + }() + } + + return if (result == "start12") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.2.kt new file mode 100644 index 00000000000..dff81fd226e --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.2.kt @@ -0,0 +1,7 @@ +package test + +inline fun inlineFun(arg: T, crossinline f: (T) -> Unit) { + { + f(arg) + }() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt new file mode 100644 index 00000000000..81436d23f2c --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "fail" + test { it -> result = it } + return result +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.2.kt new file mode 100644 index 00000000000..c12fb4a85a7 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.2.kt @@ -0,0 +1,18 @@ +package test + +interface A { + fun run() +} + +inline fun testNested(crossinline f: (String) -> Unit) { + object : A { + override fun run() { + f("OK") + } + }.run() +} + +fun test(f: (String) -> Unit) { + testNested { it -> { f(it) }()} +} + diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt new file mode 100644 index 00000000000..20374b19e51 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "fail" + B("O", "K").test { it -> result = it } + return result +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.2.kt new file mode 100644 index 00000000000..a66480afe80 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.2.kt @@ -0,0 +1,22 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f: (String) -> Unit) { + object : A { + override fun run() { + f(o) + } + }.run() + } + + inline fun test(crossinline f: (String) -> Unit) { + testNested { it -> { f(it + k) }() } + } + + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.2.kt new file mode 100644 index 00000000000..5d2facc7667 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.2.kt @@ -0,0 +1,30 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) { + { + f(arg + addParam) + }() + } + + fun box(): String { + { + inlineFun("1") { c -> + inlineFun("2") { a -> + { + { + result = param + c + a + }() + }() + } + + } + }() + + return if (result == "start1_additional_2_additional_") "OK" else "fail: $result" + } +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.2.kt new file mode 100644 index 00000000000..531d2ba719f --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.2.kt @@ -0,0 +1,28 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, f: (String) -> Unit) { + f(arg + addParam) + } + + fun box(): String { + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + { + result = param + c + a + }() + }() + } + }() + } + + return if (result == "start1_additional_2_additional_") "OK" else "fail: $result" + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.2.kt new file mode 100644 index 00000000000..318a290ea06 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.2.kt @@ -0,0 +1,24 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) { + { + f(arg + addParam) + }() + } + + + fun box(): String { + inlineFun("2") { a -> + { + result = param + a + }() + } + return if (result == "start2_additional_") "OK" else "fail: $result" + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.2.kt new file mode 100644 index 00000000000..28a19b9cf19 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.2.kt @@ -0,0 +1,26 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) { + { + f(arg + addParam) + }() + } + + + fun box(): String { + { + inlineFun("2") { a -> + { + result = param + a + }() + } + }() + return if (result == "start2_additional_") "OK" else "fail: $result" + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.2.kt new file mode 100644 index 00000000000..b9b145b5dc8 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.2.kt @@ -0,0 +1,29 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) { + { + f(arg + addParam) + }() + } + + fun box(): String { + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + { + result = param + c + a + }() + }() + } + }() + } + + return if (result == "start1_additional_2_additional_") "OK" else "fail: $result" + } +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt new file mode 100644 index 00000000000..e38412e5362 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().box() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.2.kt new file mode 100644 index 00000000000..53928ec1898 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.2.kt @@ -0,0 +1,29 @@ +package test + +class A { + val param = "start" + var result = "fail" + var addParam = "_additional_" + + inline fun inlineFun(arg: String, crossinline f: (String) -> Unit) { + { + f(arg + addParam) + }() + } + + fun box(): String { + inlineFun("1") { c -> + { + inlineFun("2") { a -> + { + result = param + c + a + }() + } + }() + } + + return if (result == "start1_additional_2_additional_") "OK" else "fail: $result" + } + + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt new file mode 100644 index 00000000000..7f3f305ecf1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "fail" + B("O", "fail").test { it -> result = it } + return result +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.2.kt new file mode 100644 index 00000000000..c04c9a3c4e1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.2.kt @@ -0,0 +1,21 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f: (String) -> Unit) { + object : A { + override fun run() { + f(o) + } + }.run() + } + + inline fun test(crossinline f: (String) -> Unit) { + testNested { it -> { f(it + "K") }() } + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt new file mode 100644 index 00000000000..7327af83692 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt @@ -0,0 +1,8 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + var result = "fail" + B("O", "K").test { it -> result = it } + return result +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.2.kt new file mode 100644 index 00000000000..e30875f5326 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.2.kt @@ -0,0 +1,22 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f: (String) -> Unit) { + object : A { + override fun run() { + f(o) + } + }.run() + } + + fun test(f: (String) -> Unit) { + testNested { it -> { f(it + k) }() } + } + + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt new file mode 100644 index 00000000000..1026144be56 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "" + B("O", "K").test { it -> result += it } + return if (result == "OOKK") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.2.kt new file mode 100644 index 00000000000..7e8c804972e --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.2.kt @@ -0,0 +1,22 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f2: (String) -> Unit, crossinline f3: (String) -> Unit) { + object : A { + override fun run() { + f2(o) + f3(k) + } + }.run() + } + + inline fun test(crossinline f: (String) -> Unit) { + testNested ({ it -> f(it + o) }) { it -> f(it + k) } + } + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt new file mode 100644 index 00000000000..1026144be56 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "" + B("O", "K").test { it -> result += it } + return if (result == "OOKK") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.2.kt new file mode 100644 index 00000000000..1d3224588c8 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.2.kt @@ -0,0 +1,31 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f: (String) -> Unit, crossinline f2: (String) -> Unit) { + object : A { + override fun run() { + f(o) + f2(k) + } + }.run() + } + + inline fun test(crossinline f: (String) -> Unit) { + call { + { + testNested ({ it -> { f(it + o) }() }) { it -> { f(it + k) }() } + }() + } + } + + inline fun call(f: () -> Unit) { + f() + } + + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt new file mode 100644 index 00000000000..f4b19adf740 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt @@ -0,0 +1,7 @@ +import test.* + +fun box(): String { + var result = "" + B("O", "K").test { it -> result += it } + return if (result == "startOOKK") "OK" else "fail: $result" +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.2.kt new file mode 100644 index 00000000000..692dbf158c6 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.2.kt @@ -0,0 +1,32 @@ +package test + +interface A { + fun run() +} + +class B(val o: String, val k: String) { + + inline fun testNested(crossinline f: (String) -> Unit, crossinline f2: (String) -> Unit) { + object : A { + override fun run() { + f(o) + f2(k) + } + }.run() + } + + inline fun test(crossinline f: (String) -> Unit) { + call { + f("start"); + { + testNested ({ it -> { f(it + o) }() }) { it -> { f(it + k) }() } + }() + } + } + + inline fun call(f: () -> Unit) { + f() + } + + +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt new file mode 100644 index 00000000000..8ab2fab3625 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return A().testCall() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.2.kt new file mode 100644 index 00000000000..efcb79b7e19 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.2.kt @@ -0,0 +1,20 @@ +package test + +class A { + + fun callK(): String { + return "K" + } + + fun callO(): String { + return "O" + } + + fun testCall(): String = test { callO() } + + inline fun test(crossinline l: () -> String): String { + return { + l() + callK() + }() + } +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt new file mode 100644 index 00000000000..f8598f8e395 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return Person("OK").sayName() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.2.kt new file mode 100644 index 00000000000..1f760941526 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.2.kt @@ -0,0 +1,15 @@ +package test + +class Person(val name: String) { + + fun sayName() = doSayName { name } + + inline fun doSayName(crossinline call: () -> String): String { + return nestedSayName1 { nestedSayName2 { call() } } + } + + fun nestedSayName1(call: () -> String) = call() + + inline fun nestedSayName2(call: () -> String) = call() +} + diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt new file mode 100644 index 00000000000..4728c85dcac --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt @@ -0,0 +1,9 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + val res = Person("OK").sayName() + if (res != "OKsubOK") return "fail: $res" + + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.2.kt new file mode 100644 index 00000000000..88c370e29e1 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.2.kt @@ -0,0 +1,14 @@ +package test + +class Person(val name: String) { + + fun sayName() = doSayName { name } + + inline fun doSayName(crossinline call: () -> String): String { + return nestedSayName1 { name + Person("sub").nestedSayName2 { call() } } + } + + fun nestedSayName1(call: () -> String) = call() + + inline fun nestedSayName2(call: () -> String) = name + call() +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt new file mode 100644 index 00000000000..b1eab3894db --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return Company("OK").sayName() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.2.kt new file mode 100644 index 00000000000..97435461444 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.2.kt @@ -0,0 +1,17 @@ +package test + +class Company(val name: String) { + fun sayName() = Person("test").doSayName { name } +} + +class Person(val name: String) { + + inline fun doSayName(crossinline call: () -> String): String { + return companyName { parsonName { call() } } + } + + inline fun parsonName(call: () -> String) = call() + + fun companyName(call: () -> String) = call() + +} diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt new file mode 100644 index 00000000000..f8598f8e395 --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt @@ -0,0 +1,6 @@ +//NO_CHECK_LAMBDA_INLINING +import test.* + +fun box(): String { + return Person("OK").sayName() +} \ No newline at end of file diff --git a/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.2.kt b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.2.kt new file mode 100644 index 00000000000..cdfa25bf19c --- /dev/null +++ b/compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.2.kt @@ -0,0 +1,14 @@ +package test + +fun Person.sayName() = doSayName { name } + +class Person(val name: String) + +inline fun Person.doSayName(crossinline call: () -> String): String { + return companyName { parsonName { call() } } +} + +inline fun Person.parsonName(call: () -> String) = call() + +fun Person.companyName(call: () -> String) = call() + diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java index afadd002a2d..0f9bdd35d7c 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/generated/BlackBoxInlineCodegenTestGenerated.java @@ -150,6 +150,171 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt9877_2.1.kt"); doTestMultiFileWithInlineCheck(fileName); } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProperRecapturing extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInProperRecapturing() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineChain.1.kt") + public void testInlineChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain.1.kt") + public void testLambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple.1.kt") + public void testLambdaChainSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_2.1.kt") + public void testLambdaChain_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_3.1.kt") + public void testLambdaChain_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("noInlineLambda.1.kt") + public void testNoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProperRecapturingInClass extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInProperRecapturingInClass() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineChain.1.kt") + public void testInlineChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("inlinelambdaChain.1.kt") + public void testInlinelambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain.1.kt") + public void testLambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple.1.kt") + public void testLambdaChainSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple_2.1.kt") + public void testLambdaChainSimple_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_2.1.kt") + public void testLambdaChain_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_3.1.kt") + public void testLambdaChain_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("noCapturedThisOnCallSite.1.kt") + public void testNoCapturedThisOnCallSite() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("noInlineLambda.1.kt") + public void testNoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambda.1.kt") + public void testTwoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambdaComplex.1.kt") + public void testTwoInlineLambdaComplex() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambdaComplex_2.1.kt") + public void testTwoInlineLambdaComplex_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class TwoCapturedReceivers extends AbstractBlackBoxInlineCodegenTest { + public void testAllFilesPresentInTwoCapturedReceivers() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("kt8668.1.kt") + public void testKt8668() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("kt8668_2.1.kt") + public void testKt8668_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("kt8668_3.1.kt") + public void testKt8668_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("twoDifferentDispatchReceivers.1.kt") + public void testTwoDifferentDispatchReceivers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + + @TestMetadata("twoExtensionReceivers.1.kt") + public void testTwoExtensionReceivers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt"); + doTestMultiFileWithInlineCheck(fileName); + } + } } @TestMetadata("compiler/testData/codegen/boxInline/argumentOrder") diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java index b158178bc7f..27d43a3f48a 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -150,6 +150,171 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/kt9877_2.1.kt"); doBoxTestWithInlineCheck(fileName); } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProperRecapturing extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInProperRecapturing() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineChain.1.kt") + public void testInlineChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/inlineChain.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain.1.kt") + public void testLambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple.1.kt") + public void testLambdaChainSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChainSimple.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_2.1.kt") + public void testLambdaChain_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_3.1.kt") + public void testLambdaChain_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/lambdaChain_3.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("noInlineLambda.1.kt") + public void testNoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturing/noInlineLambda.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class ProperRecapturingInClass extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInProperRecapturingInClass() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("inlineChain.1.kt") + public void testInlineChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlineChain.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("inlinelambdaChain.1.kt") + public void testInlinelambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/inlinelambdaChain.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain.1.kt") + public void testLambdaChain() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple.1.kt") + public void testLambdaChainSimple() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChainSimple_2.1.kt") + public void testLambdaChainSimple_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChainSimple_2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_2.1.kt") + public void testLambdaChain_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("lambdaChain_3.1.kt") + public void testLambdaChain_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/lambdaChain_3.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("noCapturedThisOnCallSite.1.kt") + public void testNoCapturedThisOnCallSite() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noCapturedThisOnCallSite.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("noInlineLambda.1.kt") + public void testNoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/noInlineLambda.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambda.1.kt") + public void testTwoInlineLambda() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambda.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambdaComplex.1.kt") + public void testTwoInlineLambdaComplex() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("twoInlineLambdaComplex_2.1.kt") + public void testTwoInlineLambdaComplex_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/properRecapturingInClass/twoInlineLambdaComplex_2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class TwoCapturedReceivers extends AbstractCompileKotlinAgainstInlineKotlinTest { + public void testAllFilesPresentInTwoCapturedReceivers() throws Exception { + KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers"), Pattern.compile("^(.+)\\.1.kt$"), true); + } + + @TestMetadata("kt8668.1.kt") + public void testKt8668() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("kt8668_2.1.kt") + public void testKt8668_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_2.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("kt8668_3.1.kt") + public void testKt8668_3() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/kt8668_3.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("twoDifferentDispatchReceivers.1.kt") + public void testTwoDifferentDispatchReceivers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoDifferentDispatchReceivers.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + + @TestMetadata("twoExtensionReceivers.1.kt") + public void testTwoExtensionReceivers() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxInline/anonymousObject/twoCapturedReceivers/twoExtensionReceivers.1.kt"); + doBoxTestWithInlineCheck(fileName); + } + } } @TestMetadata("compiler/testData/codegen/boxInline/argumentOrder")