if (!isUnboxedArrayType(pt)) return coerce(box(tree), pt);
if (!isUnboxedArrayType(pt)) return check(box(tree), pt);
    private Tree coerce(Tree tree, Type pt) {        if (isSubType(tree.type(), pt)) {            if (tree.type().symbol() == definitions.ARRAY_CLASS) {                if (pt.symbol() != definitions.ARRAY_CLASS) {                    Symbol symbol = primitives.UNBOX__ARRAY;                    Tree unboxtree = gen.mkGlobalRef(tree.pos, symbol);                    tree = gen.mkApply_V(unboxtree, new Tree[] {tree});                    return coerce(tree, pt);                }            }            return tree;        }        if (isUnboxedSimpleType(tree.type())) {            if (isUnboxedSimpleType(pt)) return convert(tree, pt);            Type to = pt.erasure();            if (!isUnboxedSimpleType(to) || isSameAs(to, tree.type()))                return box(tree);            else                return coerce(convert(tree, to), pt);        } else if (isUnboxedArrayType(tree.type())) {            if (!isUnboxedArrayType(pt)) return coerce(box(tree), pt);        } else if (isUnboxedSimpleType(pt)) {            Type from = tree.type().erasure();            if (isUnboxedSimpleType(from))                return convert(unbox(tree, from), pt);            else                return unbox(coerce(tree, boxUnboxedType(pt)), pt);        } else if (isUnboxedArrayType(pt)) {            if (tree.type.symbol() == definitions.ARRAY_CLASS)                return unbox(tree, pt);        } else if (pt.symbol() == definitions.ARRAY_CLASS) {            Tree boxtree = gen.mkGlobalRef(tree.pos, primitives.BOX__ARRAY);            return gen.mkApply_V(boxtree, new Tree[]{tree});        }        return gen.mkAsInstanceOf(tree, pt);    }