diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt index 5d3f559f4c3..b0295d362f1 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt @@ -356,7 +356,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() { value = "-Xstring-concat", valueDescription = "{indy-with-constants|indy|inline}", description = """Select code generation scheme for string concatenation. --Xstring-concat=indy-with-constants Concatenate strings using `invokedynamic` ` makeConcatWithConstants`. Requires `-jvm-target 9` or greater. +-Xstring-concat=indy-with-constants Concatenate strings using `invokedynamic` `makeConcatWithConstants`. Requires `-jvm-target 9` or greater. -Xstring-concat=indy Concatenate strings using `invokedynamic` `makeConcat`. Requires `-jvm-target 9` or greater. -Xstring-concat=inline Concatenate strings using `StringBuilder`""" ) diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index 8bec065eb41..6d7d79b5423 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -19328,6 +19328,146 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("bigArityExtLambda.kt") + public void testBigArityExtLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt"); + } + + @Test + @TestMetadata("bigArityLambda.kt") + public void testBigArityLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingValue.kt") + public void testCapturingValue() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingValue.kt"); + } + + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingVar.kt"); + } + + @Test + @TestMetadata("extensionLambda.kt") + public void testExtensionLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt"); + } + + @Test + @TestMetadata("lambdaSerializable.kt") + public void testLambdaSerializable() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt"); + } + + @Test + @TestMetadata("lambdaToSting.kt") + public void testLambdaToSting() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt"); + } + + @Test + @TestMetadata("nestedIndyLambdas.kt") + public void testNestedIndyLambdas() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); + } + + @Test + @TestMetadata("primitiveValueParameters.kt") + public void testPrimitiveValueParameters() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/primitiveValueParameters.kt"); + } + + @Test + @TestMetadata("simpleIndyLambda.kt") + public void testSimpleIndyLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/simpleIndyLambda.kt"); + } + + @Test + @TestMetadata("suspendLambda.kt") + public void testSuspendLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/suspendLambda.kt"); + } + + @Test + @TestMetadata("voidReturnType.kt") + public void testVoidReturnType() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/voidReturnType.kt"); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("lambdaWithInlineAny.kt") + public void testLambdaWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineInt.kt") + public void testLambdaWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNAny.kt") + public void testLambdaWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNInt.kt") + public void testLambdaWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNString.kt") + public void testLambdaWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineString.kt") + public void testLambdaWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") @TestDataPath("$PROJECT_ROOT") @@ -19463,38 +19603,10 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); } - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - public class Inline { - @Test - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("crossinlineLambda1.kt") - public void testCrossinlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); - } - - @Test - @TestMetadata("crossinlineLambda2.kt") - public void testCrossinlineLambda2() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); - } + @Test + @TestMetadata("voidReturnTypeAsGeneric.kt") + public void testVoidReturnTypeAsGeneric() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/voidReturnTypeAsGeneric.kt"); } @Nested 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 3786cd60da1..78cc475b292 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 @@ -2405,6 +2405,84 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt index 3775761ab7d..a640e7a7325 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/FunctionReferenceLowering.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.backend.jvm.JvmBackendContext import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin import org.jetbrains.kotlin.backend.jvm.ir.* import org.jetbrains.kotlin.backend.jvm.lower.inlineclasses.InlineClassAbi +import org.jetbrains.kotlin.builtins.functions.BuiltInFunctionArity import org.jetbrains.kotlin.config.JvmClosureGenerationScheme import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Modality @@ -101,7 +102,7 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) private fun wrapLambdaReferenceWithIndySamConversion(expression: IrBlock, reference: IrFunctionReference): IrBlock { expression.statements[expression.statements.size - 1] = wrapWithIndySamConversion(reference.type, reference) val irLambda = reference.symbol.owner - // JDK LambdaMetafactory can't adapt '(...)V' tp '(...)Lkotlin/Unit;'. + // JDK LambdaMetafactory can't adapt '(...)V' to '(...)Lkotlin/Unit;'. if (irLambda.returnType.isUnit()) { irLambda.returnType = irLambda.returnType.makeNullable() } @@ -171,7 +172,7 @@ internal class FunctionReferenceLowering(private val context: JvmBackendContext) if (plainLambda) { var parametersCount = target.valueParameters.size if (target.extensionReceiverParameter != null) ++parametersCount - if (parametersCount > 22) + if (parametersCount >= BuiltInFunctionArity.BIG_ARITY) return false } diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 549cb5dee9f..259b0f30665 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -112,7 +112,7 @@ where advanced options include: Generate metadata with strict version semantics (see kdoc on Metadata.extraInt) -Xstring-concat={indy-with-constants|indy|inline} Select code generation scheme for string concatenation. - -Xstring-concat=indy-with-constants Concatenate strings using `invokedynamic` ` makeConcatWithConstants`. Requires `-jvm-target 9` or greater. + -Xstring-concat=indy-with-constants Concatenate strings using `invokedynamic` `makeConcatWithConstants`. Requires `-jvm-target 9` or greater. -Xstring-concat=indy Concatenate strings using `invokedynamic` `makeConcat`. Requires `-jvm-target 9` or greater. -Xstring-concat=inline Concatenate strings using `StringBuilder` -Xsupport-compatqual-checker-framework-annotations=enable|disable diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt new file mode 100644 index 00000000000..7a446ba02d9 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt @@ -0,0 +1,24 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// IGNORE_LIGHT_ANALYSIS +// JVM_TARGET: 1.8 +// LAMBDAS: INDY + +fun test( + extFn: Int.( + p0: String, p1: String, + p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, + p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, + p20: Int, p21: Int, p22: Int + ) -> String +) = + 42.extFn("O", "K", 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22) + +fun box() = + test { p0: String, p1: String, + p2: Int, p3: Int, p4: Int, p5: Int, p6: Int, p7: Int, p8: Int, p9: Int, + p10: Int, p11: Int, p12: Int, p13: Int, p14: Int, p15: Int, p16: Int, p17: Int, p18: Int, p19: Int, + p20: Int, p21: Int, p22: Int + -> + p0 + p1 + } \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityFun.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt similarity index 95% rename from compiler/testData/codegen/box/invokedynamic/lambdas/bigArityFun.kt rename to compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt index 28f212bd5fb..df283781112 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityFun.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt index eb73b62dde2..3958133a62c 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt index 3ca59c13264..14206cb16ac 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt index c75f7530490..082f90a67ed 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt index 605ae5d982d..f371eded5f2 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt index f41d25b5edb..ffdf1eb303b 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt index 04efad0bf78..007188459df 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt @@ -1,6 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_BACKEND: JVM -// IGNORE_LIGHT_ANALYSIS // JVM_TARGET: 1.8 // LAMBDAS: INDY diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt new file mode 100644 index 00000000000..9cf4a35003e --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt @@ -0,0 +1,13 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 +// LAMBDAS: INDY +// FULL_JDK + +fun lambdaIsSerializable(fn: () -> Unit) = fn is java.io.Serializable + +fun box(): String { + if (lambdaIsSerializable {}) + return "Failed: indy lambdas are not serializable" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt b/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt new file mode 100644 index 00000000000..66b3bcd5941 --- /dev/null +++ b/compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt @@ -0,0 +1,14 @@ +// TARGET_BACKEND: JVM +// IGNORE_BACKEND: JVM +// JVM_TARGET: 1.8 +// LAMBDAS: INDY +// WITH_RUNTIME + +fun lambdaToString(fn: () -> Unit) = fn.toString() + +fun box(): String { + val str = lambdaToString {} + if (!str.startsWith("LambdaToStingKt")) + return "Failed: indy lambda toString is inherited from java.lang.Object" + return "OK" +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda1.kt b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt similarity index 100% rename from compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda1.kt rename to compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda2.kt b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt similarity index 100% rename from compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda2.kt rename to compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineFunInDifferentPackage.kt b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt similarity index 90% rename from compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineFunInDifferentPackage.kt rename to compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt index 7c326af1a10..880765e662f 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineFunInDifferentPackage.kt +++ b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt @@ -2,15 +2,15 @@ // JVM_TARGET: 1.8 // LAMBDAS: INDY // WITH_RUNTIME -// FILE: 2.kt -import a.* - -fun box() = test { k -> "O" + k } - // FILE: 1.kt package a fun fooK(fn: (String) -> String) = fn("K") inline fun test(crossinline lambda: (String) -> String) = - fooK { k -> lambda(k) } \ No newline at end of file + fooK { k -> lambda(k) } + +// FILE: 2.kt +import a.* + +fun box() = test { k -> "O" + k } diff --git a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineLambda1.kt b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt similarity index 92% rename from compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineLambda1.kt rename to compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt index 10f12fb9feb..9cd74080685 100644 --- a/compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineLambda1.kt +++ b/compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt @@ -2,6 +2,7 @@ // JVM_TARGET: 1.8 // LAMBDAS: INDY // WITH_RUNTIME +// NO_CHECK_LAMBDA_INLINING // FILE: 1.kt fun foo(fn: () -> Unit) = fn() diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt b/compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt similarity index 100% rename from compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt rename to compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt b/compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt similarity index 100% rename from compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt rename to compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt b/compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt similarity index 91% rename from compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt rename to compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt index 29b1ef040c9..5fb23904608 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt +++ b/compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt @@ -2,11 +2,6 @@ // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME -// FILE: 2.kt -import a.* - -fun box() = test { k -> "O" + k } - // FILE: 1.kt package a @@ -17,4 +12,9 @@ fun interface IFoo { fun fooK(iFoo: IFoo) = iFoo.foo("K") inline fun test(crossinline lambda: (String) -> String) = - fooK { k -> lambda(k) } \ No newline at end of file + fooK { k -> lambda(k) } + +// FILE: 2.kt +import a.* + +fun box() = test { k -> "O" + k } diff --git a/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt b/compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt similarity index 93% rename from compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt rename to compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt index d025660c159..b2b16edf519 100644 --- a/compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt +++ b/compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt @@ -2,6 +2,7 @@ // JVM_TARGET: 1.8 // SAM_CONVERSIONS: INDY // WITH_RUNTIME +// NO_CHECK_LAMBDA_INLINING // FILE: 1.kt fun interface IFoo { fun foo() diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 209f48390ed..e04156d5268 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -19328,6 +19328,146 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("bigArityExtLambda.kt") + public void testBigArityExtLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt"); + } + + @Test + @TestMetadata("bigArityLambda.kt") + public void testBigArityLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingValue.kt") + public void testCapturingValue() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingValue.kt"); + } + + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingVar.kt"); + } + + @Test + @TestMetadata("extensionLambda.kt") + public void testExtensionLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt"); + } + + @Test + @TestMetadata("lambdaSerializable.kt") + public void testLambdaSerializable() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt"); + } + + @Test + @TestMetadata("lambdaToSting.kt") + public void testLambdaToSting() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt"); + } + + @Test + @TestMetadata("nestedIndyLambdas.kt") + public void testNestedIndyLambdas() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); + } + + @Test + @TestMetadata("primitiveValueParameters.kt") + public void testPrimitiveValueParameters() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/primitiveValueParameters.kt"); + } + + @Test + @TestMetadata("simpleIndyLambda.kt") + public void testSimpleIndyLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/simpleIndyLambda.kt"); + } + + @Test + @TestMetadata("suspendLambda.kt") + public void testSuspendLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/suspendLambda.kt"); + } + + @Test + @TestMetadata("voidReturnType.kt") + public void testVoidReturnType() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/voidReturnType.kt"); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("lambdaWithInlineAny.kt") + public void testLambdaWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineInt.kt") + public void testLambdaWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNAny.kt") + public void testLambdaWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNInt.kt") + public void testLambdaWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNString.kt") + public void testLambdaWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineString.kt") + public void testLambdaWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") @TestDataPath("$PROJECT_ROOT") @@ -19463,38 +19603,10 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); } - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - public class Inline { - @Test - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @Test - @TestMetadata("crossinlineLambda1.kt") - public void testCrossinlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); - } - - @Test - @TestMetadata("crossinlineLambda2.kt") - public void testCrossinlineLambda2() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); - } + @Test + @TestMetadata("voidReturnTypeAsGeneric.kt") + public void testVoidReturnTypeAsGeneric() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/voidReturnTypeAsGeneric.kt"); } @Nested 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 5f620fd5bdd..f080a1b5d6e 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 @@ -2405,6 +2405,84 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") 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 ab3654ca1d5..b5a34bce5e4 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 @@ -2405,6 +2405,84 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index 3644b714fe4..61eaddb419d 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -19328,6 +19328,146 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("bigArityExtLambda.kt") + public void testBigArityExtLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt"); + } + + @Test + @TestMetadata("bigArityLambda.kt") + public void testBigArityLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt"); + } + + @Test + @TestMetadata("capturedDispatchReceiver.kt") + public void testCapturedDispatchReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedDispatchReceiver.kt"); + } + + @Test + @TestMetadata("capturedExtensionReceiver.kt") + public void testCapturedExtensionReceiver() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturedExtensionReceiver.kt"); + } + + @Test + @TestMetadata("capturingValue.kt") + public void testCapturingValue() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingValue.kt"); + } + + @Test + @TestMetadata("capturingVar.kt") + public void testCapturingVar() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/capturingVar.kt"); + } + + @Test + @TestMetadata("extensionLambda.kt") + public void testExtensionLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/extensionLambda.kt"); + } + + @Test + @TestMetadata("lambdaSerializable.kt") + public void testLambdaSerializable() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt"); + } + + @Test + @TestMetadata("lambdaToSting.kt") + public void testLambdaToSting() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt"); + } + + @Test + @TestMetadata("nestedIndyLambdas.kt") + public void testNestedIndyLambdas() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/nestedIndyLambdas.kt"); + } + + @Test + @TestMetadata("primitiveValueParameters.kt") + public void testPrimitiveValueParameters() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/primitiveValueParameters.kt"); + } + + @Test + @TestMetadata("simpleIndyLambda.kt") + public void testSimpleIndyLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/simpleIndyLambda.kt"); + } + + @Test + @TestMetadata("suspendLambda.kt") + public void testSuspendLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/suspendLambda.kt"); + } + + @Test + @TestMetadata("voidReturnType.kt") + public void testVoidReturnType() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/voidReturnType.kt"); + } + + @Nested + @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") + @TestDataPath("$PROJECT_ROOT") + public class InlineClassInSignature { + @Test + public void testAllFilesPresentInInlineClassInSignature() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("lambdaWithInlineAny.kt") + public void testLambdaWithInlineAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineInt.kt") + public void testLambdaWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNAny.kt") + public void testLambdaWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNInt.kt") + public void testLambdaWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineNString.kt") + public void testLambdaWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt"); + } + + @Test + @TestMetadata("lambdaWithInlineString.kt") + public void testLambdaWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam") @TestDataPath("$PROJECT_ROOT") @@ -19463,38 +19603,10 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/invokedynamic/sam/unboundFunctionReferenceEquality.kt"); } - @Nested - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - public class Inline { - @Test - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @Test - @TestMetadata("crossinlineLambda1.kt") - public void testCrossinlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); - } - - @Test - @TestMetadata("crossinlineLambda2.kt") - public void testCrossinlineLambda2() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); - } - - @Test - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); - } - - @Test - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); - } + @Test + @TestMetadata("voidReturnTypeAsGeneric.kt") + public void testVoidReturnTypeAsGeneric() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/sam/voidReturnTypeAsGeneric.kt"); } @Nested 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 380590b4858..b27943edb45 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 @@ -2405,6 +2405,84 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") 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 7d91fe71df6..82a9a8ed03d 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 @@ -2405,6 +2405,84 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") 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 9c4208c8c34..b33d5bef291 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 @@ -2405,6 +2405,84 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_IR_AGAINST_OLD, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") 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 02fc320c9c2..d97680edabe 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 @@ -2405,6 +2405,84 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst } } + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + public class Invokedynamic { + @Test + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true); + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + public class Lambdas { + @Test + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/lambdas/inlineLambda1.kt"); + } + } + + @Nested + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + public class Sam { + @Test + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_MULTI_MODULE_OLD_AGAINST_IR, true); + } + + @Test + @TestMetadata("crossinlineLambda1.kt") + public void testCrossinlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda1.kt"); + } + + @Test + @TestMetadata("crossinlineLambda2.kt") + public void testCrossinlineLambda2() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/crossinlineLambda2.kt"); + } + + @Test + @TestMetadata("inlineFunInDifferentPackage.kt") + public void testInlineFunInDifferentPackage() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineFunInDifferentPackage.kt"); + } + + @Test + @TestMetadata("inlineLambda1.kt") + public void testInlineLambda1() throws Exception { + runTest("compiler/testData/codegen/boxInline/invokedynamic/sam/inlineLambda1.kt"); + } + } + } + @Nested @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt index a911e111943..c0155f23963 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/directives/JvmEnvironmentConfigurationDirectives.kt @@ -54,8 +54,7 @@ object JvmEnvironmentConfigurationDirectives : SimpleDirectivesContainer() { additionalParser = JVMConstructorCallNormalizationMode.Companion::fromStringOrNull ) - @Suppress("RemoveExplicitTypeArguments") - val SAM_CONVERSIONS by enumDirective( + val SAM_CONVERSIONS by enumDirective( description = "SAM conversion code generation scheme", additionalParser = JvmClosureGenerationScheme.Companion::fromString ) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index aaabfa278ce..3f8d9dc6546 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -16183,6 +16183,21 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class Lambdas extends AbstractLightAnalysisModeTest { + @TestMetadata("bigArityExtLambda.kt") + public void ignoreBigArityExtLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityExtLambda.kt"); + } + + @TestMetadata("lambdaSerializable.kt") + public void ignoreLambdaSerializable() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaSerializable.kt"); + } + + @TestMetadata("lambdaToSting.kt") + public void ignoreLambdaToSting() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/lambdaToSting.kt"); + } + private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -16191,9 +16206,9 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } - @TestMetadata("bigArityFun.kt") - public void testBigArityFun() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityFun.kt"); + @TestMetadata("bigArityLambda.kt") + public void testBigArityLambda() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/bigArityLambda.kt"); } @TestMetadata("capturedDispatchReceiver.kt") @@ -16246,68 +16261,10 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/lambdas/voidReturnType.kt"); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("crossinlineLambda1.kt") - public void testCrossinlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda1.kt"); - } - - @TestMetadata("crossinlineLambda2.kt") - public void testCrossinlineLambda2() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inline/crossinlineLambda2.kt"); - } - - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineFunInDifferentPackage.kt"); - } - - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inline/inlineLambda1.kt"); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) public static class InlineClassInSignature extends AbstractLightAnalysisModeTest { - @TestMetadata("lambdaWithInlineInt.kt") - public void ignoreLambdaWithInlineInt() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt"); - } - - @TestMetadata("lambdaWithInlineNAny.kt") - public void ignoreLambdaWithInlineNAny() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt"); - } - - @TestMetadata("lambdaWithInlineNInt.kt") - public void ignoreLambdaWithInlineNInt() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt"); - } - - @TestMetadata("lambdaWithInlineNString.kt") - public void ignoreLambdaWithInlineNString() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt"); - } - - @TestMetadata("lambdaWithInlineString.kt") - public void ignoreLambdaWithInlineString() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt"); - } - private void runTest(String testDataFilePath) throws Exception { KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); } @@ -16320,6 +16277,31 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes public void testLambdaWithInlineAny() throws Exception { runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineAny.kt"); } + + @TestMetadata("lambdaWithInlineInt.kt") + public void testLambdaWithInlineInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineInt.kt"); + } + + @TestMetadata("lambdaWithInlineNAny.kt") + public void testLambdaWithInlineNAny() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNAny.kt"); + } + + @TestMetadata("lambdaWithInlineNInt.kt") + public void testLambdaWithInlineNInt() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNInt.kt"); + } + + @TestMetadata("lambdaWithInlineNString.kt") + public void testLambdaWithInlineNString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineNString.kt"); + } + + @TestMetadata("lambdaWithInlineString.kt") + public void testLambdaWithInlineString() throws Exception { + runTest("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature/lambdaWithInlineString.kt"); + } } } @@ -16445,39 +16427,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/invokedynamic/sam/voidReturnTypeAsGeneric.kt"); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("crossinlineLambda1.kt") - public void testCrossinlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda1.kt"); - } - - @TestMetadata("crossinlineLambda2.kt") - public void testCrossinlineLambda2() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/crossinlineLambda2.kt"); - } - - @TestMetadata("inlineFunInDifferentPackage.kt") - public void testInlineFunInDifferentPackage() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineFunInDifferentPackage.kt"); - } - - @TestMetadata("inlineLambda1.kt") - public void testInlineLambda1() throws Exception { - runTest("compiler/testData/codegen/box/invokedynamic/sam/inline/inlineLambda1.kt"); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 5a5a99456f6..a4fe195b52d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -14471,19 +14471,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -14510,19 +14497,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 e3ffa614aef..656a28746bd 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 @@ -1933,6 +1933,45 @@ public class IrJsCodegenInlineES6TestGenerated extends AbstractIrJsCodegenInline } } + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Invokedynamic extends AbstractIrJsCodegenInlineES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambdas extends AbstractIrJsCodegenInlineES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sam extends AbstractIrJsCodegenInlineES6Test { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); + } + + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); + } + } + } + @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index cb3fbff352b..a4e5bf9071b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -13956,19 +13956,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -13995,19 +13982,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 e6a9c24f270..ad8ae8af225 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 @@ -1933,6 +1933,45 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes } } + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Invokedynamic extends AbstractIrJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambdas extends AbstractIrJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sam extends AbstractIrJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); + } + + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + } + @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 18e4a0d608c..74e49b9cba6 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -14021,19 +14021,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -14060,19 +14047,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) 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 a403a626e25..52adc97aede 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 @@ -1933,6 +1933,45 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest { } } + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Invokedynamic extends AbstractJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInInvokedynamic() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/lambdas") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Lambdas extends AbstractJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInLambdas() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/lambdas"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + + @TestMetadata("compiler/testData/codegen/boxInline/invokedynamic/sam") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Sam extends AbstractJsCodegenInlineTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); + } + + public void testAllFilesPresentInSam() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxInline/invokedynamic/sam"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + } + @TestMetadata("compiler/testData/codegen/boxInline/jvmName") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 4b5c0e01b41..cd39e25ae9b 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -8092,19 +8092,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrCodegenBoxWasmTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/lambdas/inline"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/lambdas/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) @@ -8131,19 +8118,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inline") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Inline extends AbstractIrCodegenBoxWasmTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); - } - - public void testAllFilesPresentInInline() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/invokedynamic/sam/inline"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); - } - } - @TestMetadata("compiler/testData/codegen/box/invokedynamic/sam/inlineClassInSignature") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)