IR: copy annotations when making lateinit fields nullable

This commit is contained in:
pyos
2019-11-15 10:24:31 +01:00
committed by Alexander Udalov
parent 4f56b1a960
commit 1bc48c3df9
5 changed files with 31 additions and 0 deletions
@@ -0,0 +1,15 @@
// WITH_REFLECT
// TARGET_BACKEND: JVM
@Target(AnnotationTarget.FIELD)
annotation class Ann
class C {
@Ann
lateinit var x0: String
}
fun box(): String {
require(C::class.java.getDeclaredField("x0")?.getAnnotation(Ann::class.java) != null)
return "OK"
}