JVM: generate 'Deprecated' on method as runtime-visible annotation

We generate @java.lang.Deprecated annotation on methods of $DefaultImpls
classes in compatibility mode. This annotation has RUNTIME retention and
should be visible.

Also, get rid of representing annotations as Class'es (yes we know that
these annotations are in compiler CLASSPATH, but we should not rely on
such classes and associated information).
This commit is contained in:
Dmitry Petrov
2020-07-28 13:33:59 +03:00
parent 4fdccb3b35
commit 980b91d082
7 changed files with 63 additions and 19 deletions
@@ -16865,6 +16865,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/defaultArgsViaAnonymousObject.kt");
}
@TestMetadata("deprecatedAnnotation.kt")
public void testDeprecatedAnnotation() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/deprecatedAnnotation.kt");
}
@TestMetadata("inheritedFunctionWithDefaultParameters.kt")
public void testInheritedFunctionWithDefaultParameters() throws Exception {
runTest("compiler/testData/codegen/box/jvm8/defaults/compatibility/inheritedFunctionWithDefaultParameters.kt");