JVM, JVM_IR: KT-42281 proper array->primitive coercion

This commit is contained in:
Dmitry Petrov
2020-11-20 12:42:48 +03:00
parent e59c8e0a5c
commit b495fd542f
11 changed files with 53 additions and 4 deletions
@@ -672,8 +672,8 @@ public abstract class StackValue {
box(fromType, toType, v);
}
}
else if (fromType.getSort() == Type.OBJECT) {
//toType is primitive here
else if (fromType.getSort() == Type.OBJECT || fromType.getSort() == Type.ARRAY) {
// here toType is primitive and fromType is reference (object or array)
Type unboxedType = unboxPrimitiveTypeOrNull(fromType);
if (unboxedType != null) {
unbox(fromType, unboxedType, v);