Implement typeOf intrinsic on JVM

#KT-29915 Fixed
This commit is contained in:
Alexander Udalov
2019-02-21 19:47:45 +01:00
parent 5d297c40fd
commit d1e33534db
28 changed files with 950 additions and 4 deletions
@@ -21487,6 +21487,67 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/typeOf")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeOf extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTypeOf() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/typeOf"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("classes.kt")
public void testClasses() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/classes.kt");
}
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/inlineClasses.kt");
}
@TestMetadata("manyTypeArguments.kt")
public void testManyTypeArguments() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/manyTypeArguments.kt");
}
@TestMetadata("multipleLayers.kt")
public void testMultipleLayers() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/multipleLayers.kt");
}
@TestMetadata("compiler/testData/codegen/box/reflection/typeOf/noReflect")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NoReflect extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInNoReflect() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/typeOf/noReflect"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
@TestMetadata("classes.kt")
public void testClasses() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/classes.kt");
}
@TestMetadata("inlineClasses.kt")
public void testInlineClasses() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/inlineClasses.kt");
}
@TestMetadata("typeReferenceEqualsHashCode.kt")
public void testTypeReferenceEqualsHashCode() throws Exception {
runTest("compiler/testData/codegen/box/reflection/typeOf/noReflect/typeReferenceEqualsHashCode.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/typeParameters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)