Files
kotlin-fork/compiler/testData/codegen/box/evaluate/maxValueInt.kt
T
Dmitriy Novozhilov 3cffb33ab7 [FE] Drop ApproximateIntegerLiteralTypesInReceiverPosition language feature
This feature is not needed because it is unconditionally disabled for K1
  (because of not fully correct implementation) and unconditionally enabled
  in K2 (K2 does not support old behavior)

^KT-38895
2022-12-09 15:10:02 +00:00

28 lines
810 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
@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 = MyClass::class.java.getAnnotation(Ann::class.java)!!
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"
}