mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
JVM: Support using KClass as annotation parameter type
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import kotlin.reflect.KClass
|
||||
import java.lang.annotation.*
|
||||
|
||||
Retention(RetentionPolicy.RUNTIME)
|
||||
annotation
|
||||
class Ann(val args: Array<KClass<*>>)
|
||||
|
||||
fun box(): String {
|
||||
val args = javaClass<Test>().getAnnotation(javaClass<Ann>()).args
|
||||
val argName1 = args[0].simpleName ?: "fail 1"
|
||||
val argName2 = args[1].simpleName ?: "fail 2"
|
||||
return argName1 + argName2
|
||||
}
|
||||
Reference in New Issue
Block a user