JVM_IR: use nullability when boxing/unboxing inline class types
Given inline class V(Any?), a coercion from (Object, V) to (Object, V?) is boxing. In theory, the same issue in the old backend can be fixed by making `KotlinTypeMapper.mapUnderlyingTypeOfInlineClassType` use `computeExpandedTypeForInlineClass`, but for some reason this breaks a lot of stuff. #KT-48430 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
// IGNORE_BACKEND: JVM
|
||||
abstract class C<T> {
|
||||
fun foo(v: T?, x: (T) -> Any?) = v?.let { x(it) }
|
||||
}
|
||||
|
||||
inline class V(val value: Any?)
|
||||
|
||||
class D : C<V>()
|
||||
|
||||
fun box() = D().foo(V("OK")) { it.value } as String
|
||||
Reference in New Issue
Block a user