mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-11 15:53:46 +00:00
In MemberDeserializer.loadProperty, we incorrectly passed 0 to getAnnotations when loading annotations on property accessors in case the protobuf field getter_flags/setter_flags was not present. The correct behavior, as described in metadata.proto, was to pass a special "default accessor flags" value, constructed from the main property flags. Otherwise in case there were annotations both on the property and on the accessor (as in PropertyAndAccessor.kt) and the accessor was otherwise default, we would assume that it had no annotations and would not load them in compiler and reflection #KT-25499 In Progress
22 lines
524 B
Kotlin
Vendored
22 lines
524 B
Kotlin
Vendored
// WITH_REFLECT
|
|
// IGNORE_BACKEND: JVM_IR, JS_IR, JS, NATIVE
|
|
|
|
import kotlin.test.assertEquals
|
|
|
|
annotation class Ann1
|
|
annotation class Ann2
|
|
|
|
class Foo {
|
|
@setparam:Ann1
|
|
var delegate = " "
|
|
set(@Ann2 value) {}
|
|
}
|
|
|
|
fun box(): String {
|
|
val setterParameters = Foo::delegate.setter.parameters
|
|
assertEquals(2, setterParameters.size)
|
|
assertEquals("[]", setterParameters.first().annotations.toString())
|
|
assertEquals("[@Ann2(), @Ann1()]", setterParameters.last().annotations.toString())
|
|
return "OK"
|
|
}
|