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:
committed by
Space Team
parent
e290fa5f7b
commit
51ce829b96
+20
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user