diff --git a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/CompileAgainstJvmAbiTestGenerated.java b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/CompileAgainstJvmAbiTestGenerated.java index f4daccf1951..62aa24a38a4 100644 --- a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/CompileAgainstJvmAbiTestGenerated.java +++ b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/CompileAgainstJvmAbiTestGenerated.java @@ -70,6 +70,16 @@ public class CompileAgainstJvmAbiTestGenerated extends AbstractCompileAgainstJvm runTest("plugins/jvm-abi-gen/testData/compile/innerObjectRegeneration/"); } + @TestMetadata("kt-40133") + public void testKt_40133() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40133/"); + } + + @TestMetadata("kt-40340") + public void testKt_40340() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40340/"); + } + @TestMetadata("privateOnlyConstructors") public void testPrivateOnlyConstructors() throws Exception { runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/"); diff --git a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/IrCompileAgainstJvmAbiTestGenerated.java b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/IrCompileAgainstJvmAbiTestGenerated.java index c50a1392a8c..56ee94720d0 100644 --- a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/IrCompileAgainstJvmAbiTestGenerated.java +++ b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/IrCompileAgainstJvmAbiTestGenerated.java @@ -70,6 +70,16 @@ public class IrCompileAgainstJvmAbiTestGenerated extends AbstractIrCompileAgains runTest("plugins/jvm-abi-gen/testData/compile/innerObjectRegeneration/"); } + @TestMetadata("kt-40133") + public void testKt_40133() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40133/"); + } + + @TestMetadata("kt-40340") + public void testKt_40340() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40340/"); + } + @TestMetadata("privateOnlyConstructors") public void testPrivateOnlyConstructors() throws Exception { runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/"); diff --git a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LegacyCompileAgainstJvmAbiTestGenerated.java b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LegacyCompileAgainstJvmAbiTestGenerated.java index e8ec7e0abfa..a503d2e6af7 100644 --- a/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LegacyCompileAgainstJvmAbiTestGenerated.java +++ b/plugins/jvm-abi-gen/test/org/jetbrains/kotlin/jvm/abi/LegacyCompileAgainstJvmAbiTestGenerated.java @@ -70,6 +70,16 @@ public class LegacyCompileAgainstJvmAbiTestGenerated extends AbstractLegacyCompi runTest("plugins/jvm-abi-gen/testData/compile/innerObjectRegeneration/"); } + @TestMetadata("kt-40133") + public void testKt_40133() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40133/"); + } + + @TestMetadata("kt-40340") + public void testKt_40340() throws Exception { + runTest("plugins/jvm-abi-gen/testData/compile/kt-40340/"); + } + @TestMetadata("privateOnlyConstructors") public void testPrivateOnlyConstructors() throws Exception { runTest("plugins/jvm-abi-gen/testData/compile/privateOnlyConstructors/"); diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40133/app/app.kt b/plugins/jvm-abi-gen/testData/compile/kt-40133/app/app.kt new file mode 100644 index 00000000000..c0e3e508d83 --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40133/app/app.kt @@ -0,0 +1,9 @@ +package app + +import lib.* + +fun runAppAndReturnOk(): String { + var result = "Fail" + anInlineFunction { result = "OK" } + return result +} diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40133/directives.txt b/plugins/jvm-abi-gen/testData/compile/kt-40133/directives.txt new file mode 100644 index 00000000000..3f7eb8b3500 --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40133/directives.txt @@ -0,0 +1 @@ +// IGNORE_BACKEND_LEGACY: JVM \ No newline at end of file diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40133/lib/lib.kt b/plugins/jvm-abi-gen/testData/compile/kt-40133/lib/lib.kt new file mode 100644 index 00000000000..963c1012f0d --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40133/lib/lib.kt @@ -0,0 +1,11 @@ +package lib + +inline fun anInlineFunction(crossinline crossInlineLamba: () -> Unit) { + Foo().apply { + barMethod { crossInlineLamba() } + } +} + +class Foo { + fun barMethod(aLambda: () -> Unit) { aLambda() } +} diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40340/app/app.kt b/plugins/jvm-abi-gen/testData/compile/kt-40340/app/app.kt new file mode 100644 index 00000000000..13fe3e6c01a --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40340/app/app.kt @@ -0,0 +1,7 @@ +package app + +import lib.* + +fun runAppAndReturnOk(): String { + return inlineFunctionTakingSam { "OK" } +} diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40340/directives.txt b/plugins/jvm-abi-gen/testData/compile/kt-40340/directives.txt new file mode 100644 index 00000000000..3f7eb8b3500 --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40340/directives.txt @@ -0,0 +1 @@ +// IGNORE_BACKEND_LEGACY: JVM \ No newline at end of file diff --git a/plugins/jvm-abi-gen/testData/compile/kt-40340/lib/lib.kt b/plugins/jvm-abi-gen/testData/compile/kt-40340/lib/lib.kt new file mode 100644 index 00000000000..9591c8e7dae --- /dev/null +++ b/plugins/jvm-abi-gen/testData/compile/kt-40340/lib/lib.kt @@ -0,0 +1,11 @@ +package lib; + +import java.util.function.Supplier + +fun withSupplier(s: Supplier): String { + return s.get() +} + +inline fun inlineFunctionTakingSam(noinline stringSupplierFunction: () -> String): String { + return withSupplier(stringSupplierFunction) +}