mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
16 lines
289 B
Kotlin
Vendored
16 lines
289 B
Kotlin
Vendored
// IGNORE_BACKEND: JS
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.reflect.findAnnotation
|
|
|
|
annotation class Yes(val value: String)
|
|
annotation class No(val value: String)
|
|
|
|
@Yes("OK")
|
|
@No("Fail")
|
|
class Foo
|
|
|
|
fun box(): String {
|
|
return Foo::class.findAnnotation<Yes>()?.value ?: "Fail: no annotation"
|
|
}
|