Files
kotlin/compiler/testData/codegen/boxWithStdlib/evaluate/maxValueInt.kt
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

23 lines
770 B
Kotlin
Vendored

@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Int,
val p4: Long,
val p5: Int
)
Ann(
p1 = java.lang.Integer.MAX_VALUE + 1,
p2 = 1 + 1,
p4 = 1 + 1,
p5 = 1.toInt() + 1.toInt()
) class MyClass
fun box(): String {
val annotation = javaClass<MyClass>().getAnnotation(javaClass<Ann>())!!
if (annotation.p1 != -2147483648) return "fail 1, expected = ${-2147483648}, actual = ${annotation.p1}"
if (annotation.p2 != 2) return "fail 2, expected = ${2}, actual = ${annotation.p2}"
if (annotation.p4 != 2.toLong()) return "fail 4, expected = ${2}, actual = ${annotation.p4}"
if (annotation.p5 != 2) return "fail 5, expected = ${2}, actual = ${annotation.p5}"
return "OK"
}