Fix generation of elvis with null constant for inline classes
This commit is contained in:
+16
@@ -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()
|
||||
}
|
||||
Vendored
+13
@@ -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
|
||||
Reference in New Issue
Block a user