609d696202
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).
19 lines
572 B
Kotlin
Vendored
19 lines
572 B
Kotlin
Vendored
annotation(retention = AnnotationRetention.RUNTIME) class Ann(
|
|
val p1: Int,
|
|
val p2: Int,
|
|
val p3: Int,
|
|
val p4: Int,
|
|
val p5: Int
|
|
)
|
|
|
|
Ann(1 plus 1, 1 minus 1, 1 times 1, 1 div 1, 1 mod 1) class MyClass
|
|
|
|
fun box(): String {
|
|
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
|
|
if (annotation.p1 != 2) return "fail 1"
|
|
if (annotation.p2 != 0) return "fail 2"
|
|
if (annotation.p3 != 1) return "fail 3"
|
|
if (annotation.p4 != 1) return "fail 4"
|
|
if (annotation.p5 != 0) return "fail 5"
|
|
return "OK"
|
|
} |