Test reification of type parameters into Array(size, init)
(cherry picked from commit 6daa61ef5f)
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
// FILE: 1.kt
|
||||||
|
package test
|
||||||
|
|
||||||
|
inline fun <reified T> f(x : () -> T): Array<T> = Array(1) { x() }
|
||||||
|
|
||||||
|
// FILE: 2.kt
|
||||||
|
|
||||||
|
import test.*
|
||||||
|
|
||||||
|
fun box(): String = f { "OK" }[0]
|
||||||
+5
@@ -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);
|
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")
|
@TestMetadata("capturedLambda.kt")
|
||||||
public void testCapturedLambda() throws Exception {
|
public void testCapturedLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
||||||
|
|||||||
Generated
+5
@@ -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);
|
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")
|
@TestMetadata("capturedLambda.kt")
|
||||||
public void testCapturedLambda() throws Exception {
|
public void testCapturedLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
||||||
|
|||||||
+5
@@ -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);
|
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")
|
@TestMetadata("capturedLambda.kt")
|
||||||
public void testCapturedLambda() throws Exception {
|
public void testCapturedLambda() throws Exception {
|
||||||
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
runTest("compiler/testData/codegen/boxInline/reified/capturedLambda.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user