Files
kotlin-fork/compiler/testData/codegen/box/involvesIrInterpreter/unsignedConst.kt
T

19 lines
603 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: JVM
// DONT_TARGET_EXACT_BACKEND: JS
// WITH_STDLIB
fun <T> T.id() = this
const val byteVal: UByte = <!EVALUATED("1")!>1u<!>
const val shortVal: UShort = <!EVALUATED("2")!>2u<!>
const val intVal: UInt = <!EVALUATED("3")!>3u<!>
const val longVal: ULong = <!EVALUATED("4")!>4uL<!>
// STOP_EVALUATION_CHECKS
fun box(): String {
if (byteVal.id() != 1u.toUByte()) return "Fail 1"
if (shortVal.id() != 2u.toUShort()) return "Fail 2"
if (intVal.id() != 3u.toUInt()) return "Fail 3"
if (longVal.id() != 4u.toULong()) return "Fail 4"
return "OK"
}