mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-10 08:31:29 +00:00
28 lines
533 B
Kotlin
Vendored
28 lines
533 B
Kotlin
Vendored
// !USE_EXPERIMENTAL: kotlin.ExperimentalStdlibApi
|
|
// IGNORE_BACKEND_FIR: JVM_IR
|
|
// TARGET_BACKEND: JVM
|
|
// WITH_REFLECT
|
|
|
|
import kotlin.reflect.full.hasAnnotation
|
|
import kotlin.test.assertFalse
|
|
import kotlin.test.assertTrue
|
|
|
|
annotation class Baz
|
|
annotation class Far
|
|
|
|
@Baz
|
|
@Far
|
|
class Foo
|
|
|
|
class Bar
|
|
|
|
fun box(): String {
|
|
assertFalse(Bar::class.hasAnnotation<Baz>())
|
|
assertFalse(Bar::class.hasAnnotation<Far>())
|
|
|
|
assertTrue(Foo::class.hasAnnotation<Baz>())
|
|
assertTrue(Foo::class.hasAnnotation<Far>())
|
|
|
|
return "OK"
|
|
}
|