return isTrivial(type)
return (isTrivial(type) && !isSpecial(type))
        public Tree transform(Tree tree) {            switch (tree) {            case ClassDef(_, _, _, _, _, Tree.Template impl):                Symbol clsSym = tree.symbol();                TreeList newBody = new TreeList();                if (!isNestedClass(clsSym)) {                    Symbol tcSym = getTConstructorSym(clsSym);                    newBody.append(tConstructorVal(clsSym, tcSym));                    Symbol ciSym = getClassInitSym(clsSym);                    newBody.append(classInitialiser(clsSym, ciSym, tcSym));                    Symbol imSym = getInstMethSym(clsSym);                    newBody.append(instantiatorBody(clsSym, imSym));                }                newBody.append(transformStatements(impl.body, impl.symbol()));                return gen.ClassDef(clsSym,                                    transform(impl.parents,                                              clsSym.primaryConstructor()),                                    impl.symbol(),                                    newBody.toArray());            case DefDef(_, _, _, _, _, Tree rhs):                Symbol symbol = getSymbolFor(tree);                if (symbol.name == Names.getType && symbol.isSynthetic()) {                    // Correct the body of the getType method which,                    // until now, was a placeholder (introduced by                    // RefCheck).                    return gen.DefDef(symbol,                                      scalaClassType(symbol.pos,                                                     symbol.owner().type(),                                                     symbol,                                                     EENV));                } else                    return gen.DefDef(symbol, transform(rhs, symbol));            case Block(Tree[] stats, Tree value):                return gen.Block(tree.pos,                                 transformStatements(stats),                                 transform(value));            case ValDef(_, _, Tree tpe, Literal(AConstant.ZERO)):                // transform default values:                //   val x: T = _                // becomes                //   val x: T = asValue(T).defaultValue()                Symbol symbol = getSymbolFor(tree);                Tree defaultValue =                    gen.mkRef(tree.pos,                              typeAsValue(tree.pos,                                          tpe.type,                                          currentOwner,                                          EENV),                              defs.TYPE_DEFAULTVALUE());                Tree rhs = gen.mkApply__(tree.pos, defaultValue);                return gen.ValDef(symbol, rhs);            case ValDef(_, _, _, Tree rhs):                Symbol symbol = getSymbolFor(tree);                return gen.ValDef(symbol, transform(rhs, symbol));            case New(Apply(TypeApply(Tree fun, Tree[] targs), Tree[] vargs)):                // TODO still needed?                if (fun.symbol() == ARRAY_CONSTRUCTOR && false) {                    // Transform array creations:                    //   new Array[T](size)                    // becomes                    //   asValue(T).newArray[T](size)                    assert targs.length == 1;                    assert vargs.length == 1;                    Tree newArrayfun = gen.mkRef(tree.pos,                                                 typeAsValue(targs[0].pos,                                                             targs[0].type,                                                             currentOwner,                                                             EENV),                                                 defs.TYPE_NEWARRAY());                    return gen.mkApplyTV(newArrayfun, targs, vargs);                } else                    return super.transform(tree);            case Apply(TypeApply(Tree fun, Tree[] targs), Tree[] vargs):                Symbol funSym = fun.symbol();                if (funSym == defs.ANY_IS) {                    assert targs.length == 1 && vargs.length == 0;                    Type type = targs[0].type;                    Tree expr = transform(qualifierOf(fun));                    return isTrivial(type)                        ? super.transform(tree)                        : genInstanceTest(tree.pos, expr, type);                } else if (funSym == defs.ANY_AS) {                    // Transform instance tests:                    //   e.asInstanceOf[T]                    // becomes:                    //   asValue(T).cast(e).asInstanceOf[T]                    // unless T is a trivial type for which a Java                    // instance test is sufficient, in which case the                    // expression is left as is.                    assert targs.length == 1 && vargs.length == 0;                    Type type = targs[0].type;                    Tree expr = transform(qualifierOf(fun));                    return isTrivial(type)                        ? super.transform(tree)                        : genTypeCast(tree.pos, expr, type);                } else if (!monoPrimitive(funSym)) {                    // Transform applications to pass types as values:                    //   f[T1, ...](v1, ...)                    // becomes                    //   f[T1, ...](asValue(T1), ..., v1, ...)                    Tree[] newVArgs = transform(vargs);                    Tree[] finalVArgs =                        new Tree[newVArgs.length + targs.length];                    for (int i = 0; i < targs.length; ++i)                        finalVArgs[i] = typeAsValue(targs[i].pos,                                                    targs[i].type,                                                    currentOwner,                                                    EENV);                    System.arraycopy(newVArgs, 0,                                     finalVArgs, targs.length,                                     newVArgs.length);                    return gen.mkApplyTV(tree.pos,                                         transform(fun),                                         targs,                                         finalVArgs);                } else                    return super.transform(tree);            default:                return super.transform(tree);            }        }