if (sym != null && sym.isCaseFactory()) sym = sym.type().resultType().symbol().constructor();
    public Tree mkTypeApply(Tree tree, Symbol[] tparams, Type restype, Type[] targs) {	Tree tree1 = tree; 	Symbol sym = tree.symbol();	if (sym != null && sym.isCaseFactory())	    sym = sym.type().resultType().symbol().constructor();	int i = 0;	while (i < tparams.length && tparams[i].owner() == sym) 	    i++;	if (i < tparams.length) {	    //System.out.println("tpar " + tparams[i] + " of " + tparams[i].owner() + " <> " + sym);//DEBUG	    //new Printer().print(tree1);//DEBUG	    //System.out.println(ArrayApply.toString(targs) + "/" + i + "/" + ArrayApply.toString(tparams));//DEBUG	    Symbol[] tparams1 = new Symbol[tparams.length - i];	    System.arraycopy(tparams, i, tparams1, 0, tparams1.length);	    Type[] targs1 = new Type[tparams.length - i];	    System.arraycopy(targs, i, targs1, 0, targs1.length);	    tree1 = substituter.apply(tree1, tparams1, targs1);	}	if (0 < i) {	    Tree[] argtrees = new Tree[i];	    for (int j = 0; j < i; j++)		argtrees[j] = gen.mkType(tree.pos, targs[j]);	    tree1 = make.TypeApply(tree.pos, tree1, argtrees);	}	//System.out.println(Sourcefile.files[Position.file(tree1.pos)] + ": ");	return tree1.setType(restype.subst(tparams, targs));    }