Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/boxNullableForFakeOverride.kt
T
pyos 5e4f022c59 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
2021-08-31 12:05:34 +03:00

11 lines
205 B
Kotlin
Vendored

// 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