Files
kotlin-fork/compiler/testData/codegen/bytecodeText/inlineClasses/unboxInlineClassAfterElvis.kt
T
pyos 67a6785f63 FIR DFA: move eq/notEq null-to-type translation to LogicSystem
This makes the `returns() implies` checker slightly cleaner, and also
fixes the case that I've missed where in RHS of `x ?:` type of `x` was
not set to `Nothing?`.
2022-11-22 15:44:37 +00:00

22 lines
420 B
Kotlin
Vendored

// !LANGUAGE: +InlineClasses
// IGNORE_BACKEND_K2: JVM_IR
// FIR_STATUS: `x ?: x!!` assumed to throw if x is null, so only 2 unboxings
// FILE: utils.kt
inline class UInt(private val u: Int)
// FILE: test.kt
fun test(x: UInt?, y: UInt) {
val a = x ?: y // unbox
val b = x ?: x!! // unbox unbox
}
// @TestKt.class:
// 0 INVOKESTATIC UInt\$Erased.box
// 3 INVOKEVIRTUAL UInt.unbox
// 0 valueOf
// 0 intValue