Youssef Shoaib [MOD]
12/26/2024, 4:56 PMoperator fun Foo.provideDelegate(thisRef: Any?, prop: KProperty<*>): Bar {
val annotations = prop.annotations // always empty
}
fun main() {
@Baz
val foo by Foo
}
@Retention(AnnotationRetention.RUNTIME)
annotation class Baz
object Foo
prop.annotations
always seems to be empty. I understand that there's something about retaining the annotations for local variables? But since this is a local property, I'd expect that you'd be able to preserve it somewhere in the Kotlin reflection info, no?
Edit: digging deeper, seems that the property's protobuf has a NonEmptyDeserializedAnnotations
that then returns an empty list for some reason. Very strangYoussef Shoaib [MOD]
12/26/2024, 5:49 PMkotlin-metadata
somehow fix this? I'd be perfectly content using it if it can detect these local property annotationsYoussef Shoaib [MOD]
12/26/2024, 6:15 PMTóth István Zoltán
12/27/2024, 4:39 AMb
.
If it is not in IR, I guess it will be missing from the generated code as well.
fun a(
@Adaptive b : () -> Unit
)
udalov
Youssef Shoaib [MOD]
01/09/2025, 9:08 PM