Files
kotlin-fork/compiler/testData/codegen/bytecodeText/inlineClasses/toStringOfInlineClassValue.kt
T
Mark Punzalan 238cc7c257 [FIR] Enable BytecodeText tests for FIR.
143 out of 767 tests (18.6%) are currently failing.
2020-09-29 10:21:21 +03:00

17 lines
478 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Z.kt
inline class Z(val x: Int)
// FILE: test.kt
fun testZ(z: Z) = z.toString()
fun testZT(z: Z) = "$z"
fun testNZ(z: Z?) = z?.toString() // unboxed into Int after the null check
fun testNZA(z: Z?) = z.toString() // calls Any?.toString() on boxed value
fun testNZT(z: Z?) = "$z" // same
// @TestKt.class:
// 3 INVOKESTATIC Z\.toString-impl \(I\)Ljava/lang/String;
// 2 INVOKESTATIC java/lang/String.valueOf