if (args.length == 1 && fn2.symbol() == definitions.PREDEF_ARRAY()) { throw new ApplicationError("this should not happen");
    public Tree transform(Tree tree) {	//global.debugPrinter.print("lifting ").print(tree).println().end();//DEBUG	//System.out.print(tree.type + " --> ");//DEBUG	tree.type = descr.transform(tree.type, currentOwner);	//System.out.println(tree.type);//DEBUG        switch (tree) {	case Block(Tree[] stats, Tree value):	    for (int i = 0; i < stats.length; i++)		liftSymbol(stats[i]);	    return copy.Block(tree, transform(stats), transform(value));	case ClassDef(int mods, _, AbsTypeDef[] tparams, ValDef[][] vparams, Tree tpe, Template impl):	    Symbol sym = tree.symbol();	    if ((mods & LIFTED) != 0) {		((ClassDef) tree).mods &= ~LIFTED;		Tree tree1 = copy.ClassDef(		    tree, sym,		    addTypeParams(transform(tparams, sym), newtparams(sym.primaryConstructor())),		    new ValDef[][]{			addParams(transform(vparams, sym)[0], newparams(sym.primaryConstructor()))}, 		    transform(tpe, sym), 		    transform(impl, sym));		liftedDefs.append(tree1);		return Tree.Empty;	    } else {		assert !sym.isLocal() : sym;		return copy.ClassDef(		    tree, sym,		    transform(tparams, sym), 		    transform(vparams, sym), 		    transform(tpe, sym),		    transform(impl, sym));	    }	case DefDef(int mods, _, AbsTypeDef[] tparams, ValDef[][] vparams, Tree tpe, Tree rhs):	    Symbol sym = tree.symbol();	    if ((mods & LIFTED) != 0) {		((DefDef) tree).mods &= ~LIFTED;		Tree tree1 = copy.DefDef(		    tree, sym,		    addTypeParams(transform(tparams, sym), newtparams(sym)),		    new ValDef[][]{			addParams(transform(vparams, sym)[0], newparams(sym))}, 		    transform(tpe, sym), 		    transform(rhs, sym));		liftedDefs.append(tree1);		return Tree.Empty;	    } else {		assert !sym.isLocal() : sym;		return copy.DefDef(		    tree, sym,		    transform(tparams, sym), transform(vparams, sym), transform(tpe, sym),		    transform(rhs, sym));	    }	case AbsTypeDef(int mods, Name name, Tree rhs, Tree lobound):	    // ignore type definition as owner.	    // reason: it might be in a refinement	    // todo: handle type parameters?	    return copy.AbsTypeDef(		tree, tree.symbol(), 		transform(rhs, currentOwner),		transform(lobound, currentOwner));	case AliasTypeDef(int mods, Name name, AbsTypeDef[] tparams, Tree rhs):	    // ignore type definition as owner.	    // reason: it might be in a refinement	    // todo: handle type parameters?	    return copy.AliasTypeDef(		tree, tree.symbol(), 		transform(tparams, currentOwner),		transform(rhs, currentOwner));	    	case ValDef(_, _, _, Tree rhs):	    Symbol sym = tree.symbol();	    rhs = transform(rhs, sym);	    if ((sym.flags & CAPTURED) != 0) {		assert sym.isLocal();                switch (sym.nextType()) {                case TypeRef(_, Symbol clasz, Type[] args):                    Tree constr = gen.mkPrimaryConstructorGlobalRef(rhs.pos, clasz);                    rhs = gen.New(gen.mkApplyTV(constr, args, new Tree[]{rhs}));                    break;                default:                    throw Debug.abort("illegal case", sym.nextType());                }	    }	    return gen.ValDef(sym, rhs);	    	case Sequence(Tree[] args):               throw new ApplicationError("this should not happen");              /* // moved this to Uncurry	    Tree tree1 = gen.mkNewList(tree.pos, tree.type.typeArgs()[0], transform(args));	    //System.out.println("TUPLE: " + tree + "\n ==> \n" + tree1);//DEBUG	    return tree1;              */        case Return(Block(Tree[] stats, Tree value)):            return transform(                gen.Block(stats, gen.Return(tree.pos, tree.symbol(), value)));	case Return(Tree expr):	    if (tree.symbol() != currentOwner.enclMethod()) {		unit.error(tree.pos, "non-local return not yet implemented");	    }	    return super.transform(tree);	case Apply(Tree fn, Tree[] args):	    Symbol fsym = TreeInfo.methSymbol(fn);	    Tree fn1 = transform(fn);	    switch (fn1) {	    case TypeApply(Tree fn2, Tree[] targs):                if (args.length == 1 && fn2.symbol() == definitions.PREDEF_ARRAY()) {                      throw new ApplicationError("this should not happen");                      /* // this moved to UnCurry                    switch (args[0]) {                    case Sequence(Tree[] items):                        assert targs.length == 1: tree;                        Tree array = gen.mkNewArray(                            args[0].pos,                            targs[0].type(),                            transform(items),                            currentOwner);                        // fn2 may be like "{ println("hello"); Predef}.Array"                        switch (fn2) {                        case Select(Tree qualifier, _):                            return gen.mkBlock(args[0].pos, qualifier, array);                        default:                            throw Debug.abort("illegal case", fn2);                        }                    }                      */                }		fn1 = copy.TypeApply(		    fn1, fn2, addFreeArgs(tree.pos, get(free.ftvs, fsym), targs, true));		break;	    default: 		Tree[] targs = addFreeArgs(		    tree.pos, get(free.ftvs, fsym), Tree.EMPTY_ARRAY, true);		if (targs.length > 0)		    fn1 = gen.TypeApply(fn1, targs);	    }	    Tree[] args1 = transform(args);	    return copy.Apply(		tree, fn1, addFreeArgs(tree.pos, get(free.fvs, fsym), args1, false));	case Ident(_):	    Symbol sym = tree.symbol();	    if (isLocal(sym, currentOwner) && 		(sym.kind == TYPE || (sym.kind == VAL && !sym.isMethod()))) {		sym = descr.proxy(sym, currentOwner);	    }	    Tree tree1 = gen.mkLocalRef(tree.pos, sym);	    if ((sym.flags & CAPTURED) != 0) return gen.Select(tree1, definitions.REF_ELEM());	    else return tree1;	default:	    return super.transform(tree);        }    }