Files
kotlin-fork/compiler/testData/codegen/box/evaluate/divide.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

27 lines
840 B
Kotlin
Vendored

// !LANGUAGE: -ApproximateIntegerLiteralTypesInReceiverPosition
// IGNORE_FIR_DIAGNOSTICS
// TARGET_BACKEND: JVM
// WITH_STDLIB
@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 = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.b != 1.toByte()) return "fail 1"
if (annotation.s != 1.toShort()) return "fail 2"
if (annotation.i != 1) return "fail 3"
if (annotation.l != 1.toLong()) return "fail 4"
return "OK"
}
// EXPECTED: Ann[b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)]