if (isUnboxedType(qualifier.getType())) qualifier = box(qualifier);
if (isUnboxedType(prefix)) qualifier = box(qualifier);
    public Tree transform(Tree tree) {        switch (tree) {	case ClassDef(_, _, _, _, _, Template(_, Tree[] body)):            Symbol clasz = tree.symbol();            TreeList members = new TreeList(transform(body));            checkOverloadedTermsOf(clasz);            addBridges(clasz, members);            return gen.ClassDef(clasz, members.toArray());	case ValDef(_, _, _, Tree rhs):            Symbol field = tree.symbol();	    if (rhs != Tree.Empty) rhs = transform(rhs, field.nextType());	    return gen.ValDef(field, rhs);	case DefDef(_, _, _, _, _, Tree rhs):            Symbol method = tree.symbol();            if (rhs != Tree.Empty)                rhs = transform(rhs, method.nextType().resultType());	    return gen.DefDef(method, rhs);        case LabelDef(_, Ident[] params, Tree body):            Symbol label = tree.symbol();            body = transform(body, label.nextType().resultType());	    return gen.LabelDef(label, Tree.symbolOf(params), body);	case Assign(Tree lhs, Tree rhs):	    lhs = transform(lhs);	    rhs = transform(rhs, lhs.type);	    return gen.Assign(tree.pos, lhs, rhs);	case Return(Tree expr):            Symbol method = tree.symbol();            Type type = method.nextType().resultType();	    return gen.Return(tree.pos, method, transform(expr, type));        case New(Template(Tree[] base, Tree[] body)):            assert base.length == 1 && body.length == 0: tree;            if (tree.getType().symbol() == definitions.ARRAY_CLASS) {                switch (base[0]) {                case Apply(_, Tree[] args):                    assert args.length == 1: tree;                    Type element = getArrayElementType(tree.getType()).erasure();                    Tree size = transform(args[0]);                    return genNewUnboxedArray(tree.pos, element, size);                default:                    throw Debug.abort("illegal case", tree);                }            }	    return gen.New(tree.pos, transform(base[0]));	case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] vargs):            fun = transform(fun);            vargs = transform(vargs);            Symbol symbol = fun.symbol();            if (symbol == definitions.ANY_AS) {                assert targs.length == 1 && vargs.length == 0: tree;                return coerce(getQualifier(fun), targs[0].getType().erasure());            }            if (symbol == definitions.ANY_IS) {                assert targs.length == 1 && vargs.length == 0: tree;                Type type = targs[0].type.erasure();                if (isUnboxedSimpleType(type)) type = targs[0].type;                return gen.mkIsInstanceOf(tree.pos, getQualifier(fun), type);            }            return genApply(tree.pos, fun, vargs);	case Apply(Tree fun, Tree[] vargs):            fun = transform(fun);            vargs = transform(vargs);            switch (fun) {            case Select(Apply(Tree bfun, Tree[] bargs), _):                Symbol bsym = bfun.symbol();                if (primitives.getPrimitive(bsym) != Primitive.BOX) break;                assert bargs.length == 1: fun;                switch (primitives.getPrimitive(fun.symbol())) {                case LENGTH:                    assert vargs.length == 0: tree;                    Tree array = bargs[0];                    return genUnboxedArrayLength(tree.pos, array);                case APPLY:                    assert vargs.length == 1: tree;                    Tree array = bargs[0];                    Tree index = vargs[0];                    return genUnboxedArrayGet(tree.pos, array, index);                case UPDATE:                    assert vargs.length == 2: tree;                    Tree array = bargs[0];                    Tree index = vargs[0];                    Tree value = vargs[1];                    return genUnboxedArraySet(tree.pos, array, index, value);                }            }            return genApply(tree.pos, fun, vargs);	case Select(Tree qualifier, _):            Type prefix = qualifier.getType();            Symbol symbol = tree.symbol();            qualifier = transform(qualifier);            qualifier = coerce(qualifier, prefix.erasure());            // Might end up with "box(unbox(...))". That's needed by backend.            if (isUnboxedType(qualifier.getType())) qualifier = box(qualifier);	    return gen.Select(tree.pos, qualifier, symbol);	case Ident(_):            Symbol symbol = tree.symbol();	    if (symbol == definitions.ZERO) return gen.mkNullLit(tree.pos);            return gen.Ident(tree.pos, symbol);        case Block(_):	case If(_, _, _):        case Switch(_, _, _, _):            return transform(tree, tree.getType().fullErasure());        default:            return super.transform(tree);        }    }