Reflection: add KClass.isInstance, KClass.cast, KClass.safeCast

#KT-11284 Fixed
This commit is contained in:
Alexander Udalov
2016-07-12 18:48:37 +03:00
parent 3702f4a7a7
commit ada81923dc
7 changed files with 136 additions and 3 deletions
@@ -12235,6 +12235,21 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/isInstance")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class IsInstance extends AbstractBlackBoxCodegenTest {
public void testAllFilesPresentInIsInstance() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/reflection/isInstance"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("isInstanceCastAndSafeCast.kt")
public void testIsInstanceCastAndSafeCast() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/reflection/isInstance/isInstanceCastAndSafeCast.kt");
doTest(fileName);
}
}
@TestMetadata("compiler/testData/codegen/box/reflection/kClassInAnnotation")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)