Introduce declaration checker for DeprecatedSinceKotlin annotation

- DeprecatedSinceKotlin annotation should only be applicable when
   there's `@Deprecated` annotation on the same declaration
 - Deprecation level shouldn't be specified in the relevant
   `@Deprecated` annotation
 - Check that warningSince <= errorSince <= hiddenSince
This commit is contained in:
Mikhail Zarechenskiy
2020-06-17 15:52:57 +03:00
parent 0aaf29c045
commit 60c51476f2
12 changed files with 199 additions and 8 deletions
@@ -6664,6 +6664,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin"), Pattern.compile("^(.*)\\.kts?$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
}
@TestMetadata("deprecatedSinceKotlinDeclaration.kt")
public void testDeprecatedSinceKotlinDeclaration() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/deprecatedSinceKotlinDeclaration.kt");
}
@TestMetadata("error.kt")
public void testError() throws Exception {
runTest("compiler/testData/diagnostics/tests/deprecated/deprecatedSinceKotlin/error.kt");