Fix reflection class lookup in default package

Do not append "." to the name of the class in the default package.
This commit is contained in:
Alexander Udalov
2022-09-29 01:33:24 +02:00
committed by Space Team
parent e290fa5f7b
commit 51ce829b96
6 changed files with 57 additions and 3 deletions
@@ -0,0 +1,20 @@
// TARGET_BACKEND: JVM
// WITH_REFLECT
import kotlin.reflect.KClass
import kotlin.test.assertEquals
import kotlin.test.assertTrue
annotation class Nested(val value: String)
@Target(AnnotationTarget.TYPE)
annotation class Anno(
val aa: Array<Nested>,
)
fun f(): @Anno([Nested("OK")]) Unit {}
fun box(): String {
val anno = ::f.returnType.annotations.single() as Anno
return anno.aa[0].value
}