Files
kotlin/compiler/testData/codegen/box/reflection/annotations/annotationsOnJavaMembers.kt
2016-11-09 21:41:12 +03:00

33 lines
717 B
Kotlin
Vendored

// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
// WITH_REFLECT
// FILE: J.java
@Anno("J")
public class J {
@Anno("foo")
public static int foo = 42;
@Anno("bar")
public static void bar() {}
@Anno("constructor")
public J() {}
}
// FILE: K.kt
import kotlin.test.assertEquals
annotation class Anno(val value: String)
fun box(): String {
assertEquals("[@Anno(value=J)]", J::class.annotations.toString())
assertEquals("[@Anno(value=foo)]", J::foo.annotations.toString())
assertEquals("[@Anno(value=bar)]", J::bar.annotations.toString())
assertEquals("[@Anno(value=constructor)]", ::J.annotations.toString())
return "OK"
}