
    De Boom vs. Priestly et al.
    
    Where a demurrer to the complaint is put in, and overruled, and the defendant then answers, the answer is a waiver of the demurrer.
    Where a special contract for the performance of work is proved, but it is also shown that the contract has been deviated from, the judgment will not be reversed on the ground that the court below admitted testimony as to the value of the plaintiff’s services.
    Where there has been a special contract to erect a building at a specified price, and according to an agreed plan, and the contract is afterwards deviated from by consent, the plaintiff cannot recover upon the express contract; for the reason that the work has not been performed according to the terms of the express contract; though, at the trial, the measure of compensation must be graduated by the terms of the contract, so far as the work can be traced under it.
    Appeal from the superior court of the city of San Francisco. The points on which the decision is based are stated in the opinion of the court.
    
      Alexander Wells, for plaintiff.
    
      Gregory Yale, for defendants.
   By the Court,

Besnett, J.

There was a special contract between the parties for the erection of a building, which was deviated from in pursuance of instructions from the defendants. The action was brought on a quantum meruit. The defendants demurred to the complaint. The demurrer was overruled, and they put in a plea to the merits. The plea was a waiver of the demurrer, and no point can be made upon that now.

At the trial, the court admitted testimony of the value of the plaintiff’s services, though there was evidence of a special contract. But the contract had been deviated from, and therefore the evidence was proper.

The only question in the case, which presents any difficulty, arises upon the third instruction asked by the defendants. That was as follows:—“ If the jury believe that there was a special “ contract between the parties to erect the buildings at a speci- “ tied price, and according to an agreed plan, which was after- “ wards changed by consent, the plaintiffs are compelled to sue upon that special contract so far as it can be traced, and can- “ not recover upon an implied contract for work and labor, or “ for materials.”

This instruction was, however, properly refused. In such a case as this, the plaintiff can sue upon an implied contract. Indeed, should he sue upon the express contract, he must necessarily fail; because he cannot prove that the work has been done according to the terms of the contract; and he must recover, if at all,, upon an implied contract for work and labor and for materials ; though, at the trial, as the measure of compensation, the recovery must be graduated according to the terms of the contract, so far as the work can be traced under the contract. But this was not the instruction asked by the defendants. The judgment should he affirmed.

Ordered accordingly.  