mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 15:53:37 +00:00
19 lines
548 B
Kotlin
Vendored
19 lines
548 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
|
|
// WITH_REFLECT
|
|
|
|
import java.lang.annotation.Retention
|
|
import java.lang.annotation.RetentionPolicy
|
|
import kotlin.test.assertEquals
|
|
|
|
fun box(): String {
|
|
val ctor = Retention::class.constructors.single()
|
|
val r = ctor.callBy(mapOf(
|
|
ctor.parameters.single { it.name == "value" } to RetentionPolicy.RUNTIME
|
|
))
|
|
assertEquals(RetentionPolicy.RUNTIME, r.value as RetentionPolicy)
|
|
assertEquals(Retention::class.java.classLoader, r.javaClass.classLoader)
|
|
return "OK"
|
|
}
|