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:
Ilmir Usmanov
2021-02-16 09:24:49 +01:00
parent 744a0fcd25
commit 741c1a864f
19 changed files with 604 additions and 9 deletions
@@ -54,11 +54,11 @@ fun box(): String {
val a = IcAny(5)
val o = IcOverIc(IcLong(6))
if (testUnboxed(i, l, a, o) != "345IcLong(l=6)") return "Fail 1"
if (testUnboxed(i, l, a, o) != "345IcLong(l=6)") return "Fail 1 ${testUnboxed(i, l, a, o)}"
if (testBoxed(i, l, a, o) != "345IcLong(l=6)") return "Fail 2"
if (testLocalVars() != "012IcLong(l=3)") return "Fail 3"
if (testGlobalProperties() != "123IcLong(l=4)") return "Fail 4"
if (testCapturedVars() != "234IcLong(l=5)") return "Fail 5"
if (testCapturedVars() != "234IcLong(l=5)") return "Fail 5 ${testCapturedVars()}"
return "OK"
}