diff --git a/compiler/testData/codegen/boxInline/reified/arrayConstructor.kt b/compiler/testData/codegen/boxInline/reified/arrayConstructor.kt new file mode 100644 index 00000000000..0df030eafb6 --- /dev/null +++ b/compiler/testData/codegen/boxInline/reified/arrayConstructor.kt @@ -0,0 +1,10 @@ +// FILE: 1.kt +package test + +inline fun f(x : () -> T): Array = Array(1) { x() } + +// FILE: 2.kt + +import test.* + +fun box(): String = f { "OK" }[0] diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java index f5dc99002c2..8899c32ba40 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxInlineCodegenTestGenerated.java @@ -2604,6 +2604,11 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/reified"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("arrayConstructor.kt") + public void testArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java index cab47d758a1..249eba66637 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/CompileKotlinAgainstInlineKotlinTestGenerated.java @@ -2604,6 +2604,11 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/reified"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true); } + @TestMetadata("arrayConstructor.kt") + public void testArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java index 5ba382ab94f..5ef8f18f5b5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxInlineCodegenTestGenerated.java @@ -2604,6 +2604,11 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/boxInline/reified"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true); } + @TestMetadata("arrayConstructor.kt") + public void testArrayConstructor() throws Exception { + runTest("compiler/testData/codegen/boxInline/reified/arrayConstructor.kt"); + } + @TestMetadata("capturedLambda.kt") public void testCapturedLambda() throws Exception { runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");