mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 15:51:01 +00:00
25 lines
724 B
Kotlin
Vendored
25 lines
724 B
Kotlin
Vendored
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// SKIP_JDK6
|
|
// TARGET_BACKEND: JVM
|
|
// FULL_JDK
|
|
// WITH_REFLECT
|
|
|
|
package test
|
|
|
|
annotation class Anno(val value: String)
|
|
|
|
interface Test {
|
|
fun foo(@Anno("OK") a: String) = "123"
|
|
}
|
|
|
|
fun box(): String {
|
|
val testMethod = Class.forName("test.Test\$DefaultImpls").declaredMethods.single()
|
|
//return (::test.parameters.single().annotations.single() as Simple).value
|
|
val receiverAnnotations = (testMethod.parameters[0]).annotations
|
|
if (receiverAnnotations.isNotEmpty()) return "fail: receiver parameter should not have any annotations, but: ${receiverAnnotations.joinToString()}"
|
|
|
|
val value2 = ((testMethod.parameters[1]).annotations.single() as Anno).value
|
|
|
|
return value2
|
|
}
|