Files
kotlin-fork/compiler/testData/codegen/boxWithStdlib/evaluate/divide.kt
T
Mikhail Glukhikh eab288bdd7 annotation() now has no arguments. Syntax migration to Retention / Repeatable / MustBeDocumented combination
Deprecated test for annotation(params) completion deleted. A lot of tests changed.
2015-09-04 19:21:12 +03:00

21 lines
711 B
Kotlin
Vendored

@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val b: Byte,
val s: Short,
val i: Int,
val l: Long
)
Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass
fun box(): String {
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
if (annotation.b != 1.toByte()) return "fail 1"
if (annotation.s != 1.toShort()) return "fail 2"
if (annotation.i != 1) return "fail 2"
if (annotation.l != 1.toLong()) return "fail 2"
return "OK"
}
// EXPECTED: Ann[b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)]