Fix generation of elvis with null constant for inline classes

This commit is contained in:
Mikhail Zarechenskiy
2018-05-07 14:55:00 +03:00
parent 043c3d9a97
commit 5c57c799fc
8 changed files with 61 additions and 2 deletions
@@ -0,0 +1,16 @@
// !LANGUAGE: +InlineClasses
inline class UInt(private val data: Int) {
fun result(): String = if (data == 1) "OK" else "fail"
}
fun f(): UInt {
val unull = UInt(1) ?: null
return nonNull(unull)
}
fun nonNull(u: UInt?) = u!!
fun box(): String {
return f().result()
}
@@ -0,0 +1,13 @@
// !LANGUAGE: +InlineClasses
inline class UInt(private val data: Int)
fun f() {
val unull = UInt(1) ?: null
}
// 1 INVOKESTATIC UInt\$Erased.box
// 0 INVOKEVIRTUAL UInt.unbox
// 0 valueOf
// 0 intValue