Files
kotlin/compiler/testData/codegen/box/inlineClasses/kt27140.kt
2018-09-28 10:46:42 +03:00

13 lines
284 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// WITH_RUNTIME
// IGNORE_BACKEND: JVM_IR
inline class Z(private val i: Int) {
fun toByteArray() = ByteArray(1) { i.toByte() }
}
fun box(): String {
val z = Z(42)
if (z.toByteArray()[0].toInt() != 42) throw AssertionError()
return "OK"
}