Map annotation target TYPE -> TYPE_USE if JVM target >= 1.8

And TYPE_PARAMETER -> TYPE_PARAMETER similarly

 #KT-23857 Fixed
This commit is contained in:
Alexander Udalov
2018-04-25 15:48:13 +02:00
parent b7808ba24d
commit 1c2a9e4b21
9 changed files with 138 additions and 15 deletions
@@ -133,6 +133,29 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
runTest("compiler/testData/codegen/java8/box/useStream.kt");
}
@TestMetadata("compiler/testData/codegen/java8/box/annotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/java8/box/annotations"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("useTypeParameterAnnotationFromJava.kt")
public void testUseTypeParameterAnnotationFromJava() throws Exception {
runTest("compiler/testData/codegen/java8/box/annotations/useTypeParameterAnnotationFromJava.kt");
}
@TestMetadata("useTypeUseAnnotationFromJava.kt")
public void testUseTypeUseAnnotationFromJava() throws Exception {
runTest("compiler/testData/codegen/java8/box/annotations/useTypeUseAnnotationFromJava.kt");
}
}
@TestMetadata("compiler/testData/codegen/java8/box/builtinStubMethods")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)