Support type annotations

#KT-35843 Fixed
This commit is contained in:
Mikhael Bogdanov
2019-12-30 09:12:28 +01:00
parent fde9b21a40
commit 2ed0cb2a89
52 changed files with 1728 additions and 10 deletions
@@ -111,4 +111,82 @@ public class AsmLikeInstructionListingTestGenerated extends AbstractAsmLikeInstr
runTest("compiler/testData/codegen/asmLike/receiverMangling/simple.kt");
}
}
@TestMetadata("compiler/testData/codegen/asmLike/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractAsmLikeInstructionListingTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/asmLike/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("complex.kt")
public void testComplex() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/complex.kt");
}
@TestMetadata("constructor.kt")
public void testConstructor() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/constructor.kt");
}
@TestMetadata("defaultArgs.kt")
public void testDefaultArgs() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/defaultArgs.kt");
}
@TestMetadata("enumClassConstructor.kt")
public void testEnumClassConstructor() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/enumClassConstructor.kt");
}
@TestMetadata("extension.kt")
public void testExtension() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/extension.kt");
}
@TestMetadata("implicit.kt")
public void testImplicit() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/implicit.kt");
}
@TestMetadata("innerClassConstructor.kt")
public void testInnerClassConstructor() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/innerClassConstructor.kt");
}
@TestMetadata("jvmOverload.kt")
public void testJvmOverload() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmOverload.kt");
}
@TestMetadata("jvmStatic.kt")
public void testJvmStatic() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/jvmStatic.kt");
}
@TestMetadata("notYetSupported.kt")
public void testNotYetSupported() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/notYetSupported.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple.kt");
}
@TestMetadata("simple2Params.kt")
public void testSimple2Params() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/simple2Params.kt");
}
@TestMetadata("staticNested.kt")
public void testStaticNested() throws Exception {
runTest("compiler/testData/codegen/asmLike/typeAnnotations/staticNested.kt");
}
}
}
@@ -127,6 +127,24 @@ public class BlackBoxAgainstJavaCodegenTestGenerated extends AbstractBlackBoxAga
runTest("compiler/testData/codegen/boxAgainstJava/annotations/kClassMapping/varargClassParameterOnJavaClass.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractBlackBoxAgainstJavaCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations/implicitReturn.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/callableReference")
@@ -248,6 +248,34 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/annotations/annotatedLambda/samLambda.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("methodParameters.kt")
public void testMethodParameters() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/methodParameters.kt");
}
@TestMetadata("typeUseAnnotation.kt")
public void testTypeUseAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/typeUseAnnotation.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/argumentOrder")
@@ -469,4 +469,27 @@ public class CompileKotlinAgainstKotlinTestGenerated extends AbstractCompileKotl
}
}
}
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractCompileKotlinAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("typeAnnotationTarget6.kt")
public void testTypeAnnotationTarget6() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations/typeAnnotationTarget6.kt");
}
}
}
@@ -248,6 +248,34 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/annotations/annotatedLambda/samLambda.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("methodParameters.kt")
public void testMethodParameters() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/methodParameters.kt");
}
@TestMetadata("typeUseAnnotation.kt")
public void testTypeUseAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/typeUseAnnotation.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/argumentOrder")
@@ -248,6 +248,34 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/annotations/annotatedLambda/samLambda.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractFirBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTestWithCustomIgnoreDirective(this::doTest, TargetBackend.JVM_IR, testDataFilePath, "// IGNORE_BACKEND_FIR: ");
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("methodParameters.kt")
public void testMethodParameters() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/methodParameters.kt");
}
@TestMetadata("typeUseAnnotation.kt")
public void testTypeUseAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/typeUseAnnotation.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/argumentOrder")
@@ -128,6 +128,24 @@ public class IrBlackBoxAgainstJavaCodegenTestGenerated extends AbstractIrBlackBo
runTest("compiler/testData/codegen/boxAgainstJava/annotations/kClassMapping/varargClassParameterOnJavaClass.kt");
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractIrBlackBoxAgainstJavaCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/boxAgainstJava/annotations/typeAnnotations/implicitReturn.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/boxAgainstJava/callableReference")
@@ -248,6 +248,34 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/annotations/annotatedLambda/samLambda.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/annotations/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/annotations/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("methodParameters.kt")
public void testMethodParameters() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/methodParameters.kt");
}
@TestMetadata("typeUseAnnotation.kt")
public void testTypeUseAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/annotations/typeAnnotations/typeUseAnnotation.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/argumentOrder")
@@ -464,4 +464,27 @@ public class IrCompileKotlinAgainstKotlinTestGenerated extends AbstractIrCompile
}
}
}
@TestMetadata("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeAnnotations extends AbstractIrCompileKotlinAgainstKotlinTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInTypeAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@TestMetadata("implicitReturn.kt")
public void testImplicitReturn() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations/implicitReturn.kt");
}
@TestMetadata("typeAnnotationTarget6.kt")
public void testTypeAnnotationTarget6() throws Exception {
runTest("compiler/testData/compileKotlinAgainstKotlin/typeAnnotations/typeAnnotationTarget6.kt");
}
}
}