JVM IR: Make receiver type of IrGetField not null
otherwise, it will be mapped to inline class type if underlying type is primitive of nullable. #KT-52913 Fixed
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses
|
||||
|
||||
interface MyInterface
|
||||
|
||||
var value: Any? = null
|
||||
|
||||
fun saveValue(a: Any?) {
|
||||
value = a
|
||||
}
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class MyClass(private val value: Int): MyInterface {
|
||||
fun foo(other: MyInterface) {
|
||||
saveValue((other as? MyClass)?.value)
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val x = MyClass(5)
|
||||
x.foo(x)
|
||||
if (value != 5) return "FAIL: $value"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user