Files
kotlin-fork/compiler/testData/codegen/box/objects/companionObjectAccess/primitiveCompanion/byteCompanionObject.kt
T
Georgy Bronnikov 487f500f85 Revert "JVM_IR. Support compile time constants"
This reverts commit 055215c54f.
2018-09-25 05:24:48 +03:00

21 lines
469 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
fun <T> assertEquals(a: T, b: T) { if (a != b) throw AssertionError("$a != $b") }
fun Byte.Companion.MAX() = MAX_VALUE
fun Byte.Companion.MIN() = MIN_VALUE
fun <T> test(o: T) { assertEquals(o === Byte.Companion, true) }
fun box(): String {
assertEquals(127, Byte.MAX_VALUE)
assertEquals(Byte.MIN_VALUE, Byte.MIN())
assertEquals(Byte.MAX_VALUE, Byte.Companion.MAX())
test(Byte)
test(Byte.Companion)
return "OK"
}