martmists
11/23/2025, 1:00 PM@Target(AnnotationTarget.TYPE)
@Retention(AnnotationRetention.SOURCE)
annotation class CodecLocation(val klass: KClass<*>, val field: String) // Ideally I could do CodecLocation(val prop: KProperty<*>) to specify as @CodecLocation(Codecs::B_CODEC) but that doesn't seem to work
@Codec
data class A(
val b: @CodecLocation(Codecs::class, "B_CODEC") B
)
typealias CodecB = @CodecLocation(Codecs::class, "B_CODEC") B
@Codec
data class A2(
val b: CodecB
)
In A I can grab param.type.annotations[0] to get the CodecLocation annotation, but in A2 it seems to just resolve as B with no annotations present. How can I still get the annotation in A2?