Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/kt27140.kt
T
2021-12-15 17:14:22 +00:00

14 lines
311 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
OPTIONAL_JVM_INLINE_ANNOTATION
value 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"
}