JVM_IR: IC: Unbox inline class argument of callable reference
if it is unbound and the underlying type is reference type. If the underlying type is primitive, it is boxed and unboxed correctly, otherwise, it is simply casted and not unboxed. Additionally, generate functions for inliner with inline classes in signature, so unboxing works. The unboxing is removed after inlining. #KT-44722 Fixed
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
inline class Value(val value: String?)
|
||||
|
||||
object Foo {
|
||||
fun foo(value: Value) {
|
||||
res = value.value!!
|
||||
}
|
||||
|
||||
fun bar(value: Value?) {
|
||||
res = value?.value!!
|
||||
}
|
||||
}
|
||||
|
||||
var res = "FAIL"
|
||||
|
||||
fun box(): String {
|
||||
Value("OK").let(Foo::foo)
|
||||
if (res != "OK") return "FAIL 1: $res"
|
||||
res = "FAIL"
|
||||
|
||||
Value("OK").let(Foo::bar)
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user