diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt index d13b3b14322..771d29e273c 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/AdapterGenerator.kt @@ -560,7 +560,7 @@ internal class AdapterGenerator( isInline = false, isExternal = false, isTailrec = false, - isSuspend = true, + isSuspend = false, isOperator = false, isInfix = false, isExpect = false, 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 91cd48ef7bb..2a9dbe9a9c2 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 @@ -3576,6 +3576,22 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt b/compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt new file mode 100644 index 00000000000..cbc956972cf --- /dev/null +++ b/compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt @@ -0,0 +1,13 @@ +// !LANGUAGE: +AllowKotlinFunInterfaceConstructorReference +// IGNORE_BACKEND: JVM, JS +// ^ feature supported in IR-based backends only + +fun interface KSupplier { + fun get(): T +} + +val ks: (() -> String) -> KSupplier = + ::KSupplier + +fun box(): String = + ks { "OK" }.get() diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt index 02f7a46d0a8..18270ebfdb1 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt @@ -60,69 +60,69 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.reflect.KFunction1, .KRunnable> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0 EXPRESSION_BODY TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable GET_VAR 'function: kotlin.Function0 declared in .test1.KRunnable' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable [suspend] declared in .test1' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable declared in .test1' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test1a visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1, .KRunnable> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1a (): kotlin.reflect.KFunction1, .KRunnable> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0 EXPRESSION_BODY TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable GET_VAR 'function: kotlin.Function0 declared in .test1a.KRunnable' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable [suspend] declared in .test1a' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable declared in .test1a' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test1b visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction<.KRunnable> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1b (): kotlin.reflect.KFunction<.KRunnable> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KRunnable visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KRunnable VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0 EXPRESSION_BODY TYPE_OP type=.KRunnable origin=SAM_CONVERSION typeOperand=.KRunnable GET_VAR 'function: kotlin.Function0 declared in .test1b.KRunnable' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable [suspend] declared in .test1b' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KRunnable (function: kotlin.Function0): .KRunnable declared in .test1b' type=kotlin.reflect.KFunction1, .KRunnable> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Function1, .KSupplier> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Function1, .KSupplier> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KSupplier [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KSupplier VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0 EXPRESSION_BODY TYPE_OP type=.KSupplier origin=SAM_CONVERSION typeOperand=.KSupplier GET_VAR 'function: kotlin.Function0 declared in .test2.KSupplier' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0): .KSupplier [suspend] declared in .test2' type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0): .KSupplier declared in .test2' type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test2a visibility:public modality:FINAL <> () returnType:kotlin.Function1, .KSupplier> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2a (): kotlin.Function1, .KSupplier> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KSupplier [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KSupplier visibility:local modality:FINAL <> (function:kotlin.Function0) returnType:.KSupplier VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function0 EXPRESSION_BODY TYPE_OP type=.KSupplier origin=SAM_CONVERSION typeOperand=.KSupplier GET_VAR 'function: kotlin.Function0 declared in .test2a.KSupplier' type=kotlin.Function0 origin=null - FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0): .KSupplier [suspend] declared in .test2a' type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KSupplier (function: kotlin.Function0): .KSupplier declared in .test2a' type=kotlin.reflect.KFunction1, .KSupplier> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Function1, .KConsumer> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (): kotlin.Function1, .KConsumer> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1) returnType:.KConsumer [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1) returnType:.KConsumer VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function1 EXPRESSION_BODY TYPE_OP type=.KConsumer origin=SAM_CONVERSION typeOperand=.KConsumer GET_VAR 'function: kotlin.Function1 declared in .test3.KConsumer' type=kotlin.Function1 origin=null - FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1): .KConsumer [suspend] declared in .test3' type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1): .KConsumer declared in .test3' type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= FUN name:test3a visibility:public modality:FINAL <> () returnType:kotlin.Function1, .KConsumer> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3a (): kotlin.Function1, .KConsumer> declared in ' BLOCK type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE - FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1) returnType:.KConsumer [suspend] + FUN ADAPTER_FOR_FUN_INTERFACE_CONSTRUCTOR name:KConsumer visibility:local modality:FINAL <> (function:kotlin.Function1) returnType:.KConsumer VALUE_PARAMETER ADAPTER_PARAMETER_FOR_CALLABLE_REFERENCE name:function index:0 type:kotlin.Function1 EXPRESSION_BODY TYPE_OP type=.KConsumer origin=SAM_CONVERSION typeOperand=.KConsumer GET_VAR 'function: kotlin.Function1 declared in .test3a.KConsumer' type=kotlin.Function1 origin=null - FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1): .KConsumer [suspend] declared in .test3a' type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= + FUNCTION_REFERENCE 'local final fun KConsumer (function: kotlin.Function1): .KConsumer declared in .test3a' type=kotlin.reflect.KFunction1, .KConsumer> origin=FUN_INTERFACE_CONSTRUCTOR_REFERENCE reflectionTarget= diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt index ea7d030a284..f6d72ccffa8 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt @@ -18,7 +18,7 @@ fun interface KConsumer { fun test1(): KFunction1, KRunnable> { return { // BLOCK - local suspend fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ + local fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ ::KRunnable } @@ -26,7 +26,7 @@ fun test1(): KFunction1, KRunnable> { fun test1a(): KFunction1, KRunnable> { return { // BLOCK - local suspend fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ + local fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ ::KRunnable } @@ -34,7 +34,7 @@ fun test1a(): KFunction1, KRunnable> { fun test1b(): KFunction { return { // BLOCK - local suspend fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ + local fun KRunnable(function: Function0): KRunnable function /*-> KRunnable */ ::KRunnable } @@ -42,7 +42,7 @@ fun test1b(): KFunction { fun test2(): Function1, KSupplier> { return { // BLOCK - local suspend fun KSupplier(function: Function0): KSupplier function /*-> KSupplier */ + local fun KSupplier(function: Function0): KSupplier function /*-> KSupplier */ ::KSupplier } @@ -50,7 +50,7 @@ fun test2(): Function1, KSupplier> { fun test2a(): Function1, KSupplier> { return { // BLOCK - local suspend fun KSupplier(function: Function0): KSupplier function /*-> KSupplier */ + local fun KSupplier(function: Function0): KSupplier function /*-> KSupplier */ ::KSupplier } @@ -58,7 +58,7 @@ fun test2a(): Function1, KSupplier> { fun test3(): Function1, KConsumer> { return { // BLOCK - local suspend fun KConsumer(function: Function1): KConsumer function /*-> KConsumer */ + local fun KConsumer(function: Function1): KConsumer function /*-> KConsumer */ ::KConsumer } @@ -66,7 +66,7 @@ fun test3(): Function1, KConsumer> { fun test3a(): Function1, KConsumer> { return { // BLOCK - local suspend fun KConsumer(function: Function1): KConsumer function /*-> KConsumer */ + local fun KConsumer(function: Function1): KConsumer function /*-> KConsumer */ ::KConsumer } 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 76904e42aa0..faba4db083c 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 @@ -3498,6 +3498,22 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @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 efe5f34c284..1fa653bbee6 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 @@ -3576,6 +3576,22 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index f03d4cfc757..7121bdc92bc 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -3064,6 +3064,24 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class FunInterfaceConstructor extends AbstractLightAnalysisModeTest { + @TestMetadata("funInterfaceConstructor.kt") + public void ignoreFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + } + @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index bfd9bdfee9c..34b02c8c4d2 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -2436,6 +2436,22 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index ddc0fc85ece..d8a110ef863 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -2478,6 +2478,22 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 336ff03056b..a19ba2b15d3 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -2204,6 +2204,24 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest } } + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class FunInterfaceConstructor extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java index 8d7fbb67ca0..8ad0197d475 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeExtBlackBoxTestGenerated.java @@ -2507,6 +2507,23 @@ public class NativeExtBlackBoxTestGenerated extends AbstractNativeBlackBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/callableReference/funInterfaceConstructor") + @TestDataPath("$PROJECT_ROOT") + @NativeBlackBoxTestCaseGroupProvider(ExtTestCaseGroupProvider.class) + public class FunInterfaceConstructor { + @Test + public void testAllFilesPresentInFunInterfaceConstructor() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/callableReference/funInterfaceConstructor"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("funInterfaceConstructor.kt") + public void testFunInterfaceConstructor() throws Exception { + runTest("compiler/testData/codegen/box/callableReference/funInterfaceConstructor/funInterfaceConstructor.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/callableReference/function") @TestDataPath("$PROJECT_ROOT")