mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 15:53:46 +00:00
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
440 B
Kotlin
Vendored
19 lines
440 B
Kotlin
Vendored
Ann(A.B.i) class MyClass
|
|
|
|
fun box(): String {
|
|
val ann = javaClass<MyClass>().getAnnotation(javaClass<Ann>())
|
|
if (ann == null) return "fail: cannot find Ann on MyClass}"
|
|
if (ann.i != 1) return "fail: annotation parameter i should be 1, but was ${ann.i}"
|
|
return "OK"
|
|
}
|
|
|
|
annotation(retention = AnnotationRetention.RUNTIME) class Ann(val i: Int)
|
|
|
|
class A {
|
|
class B {
|
|
companion object {
|
|
val i = 1
|
|
}
|
|
}
|
|
}
|