Annotations have now retention of "RUNTIME" by default. Java retention is generated as given by kotlin annotation. Annotation rendering changed.
Annotation arguments with default values are rendered as ... if renderDefaultAnnotationArguments is true. Tests: java retention does not taken into account by Descriptor comparator. Java retentinon changed to kotlin retention in some tests + one new test with java retention added. More accurate tests for intentions in byte code (visibility controlled).
This commit is contained in:
Vendored
+1
-3
@@ -1,10 +1,8 @@
|
||||
import java.lang.annotation.*
|
||||
import java.lang.reflect.Method
|
||||
import kotlin.reflect.jvm.java
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation class Ann(val x: String)
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val x: String)
|
||||
|
||||
fun testMethod(method: Method, name: String) {
|
||||
assertEquals("OK", method.getAnnotation(javaClass<Ann>()).x, "On method of test named `$name`")
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.reflect.KClass
|
||||
import java.lang.annotation.*
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val args: Array<KClass<*>>)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import kotlin.reflect.KClass
|
||||
import java.lang.annotation.*
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(val arg: KClass<*>)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
import kotlin.reflect.KClass
|
||||
import java.lang.annotation.*
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation
|
||||
annotation(retention = AnnotationRetention.RUNTIME)
|
||||
class Ann(vararg val args: KClass<*>)
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+1
-4
@@ -1,9 +1,6 @@
|
||||
import java.lang.annotation.Retention
|
||||
import java.lang.annotation.RetentionPolicy
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation class testAnnotation
|
||||
annotation(retention = AnnotationRetention.RUNTIME) class testAnnotation
|
||||
|
||||
class A {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user