This action of contract is to recover for labor performed and equipment rented pursuant to an oral contract for blasting ledge on the defendant’s premises in the city of Newton. There was evidence that between August 3 and September 22, 1956, the plaintiff worked thirty-six days; that he did not obtain a bond under G. L. c. 148, § 19 or § 20A,1 until September 6; and that he did not obtain a blasting permit from the city under G. L. c. 148, § 10A,2 at any time. The trial judge found that the bond and permit were not obtained, but refused to rule that recovery was barred, and found for the plaintiff. The Appellate Division dismissed a report. The defendant appealed.
The judge ruled that the contract was not illegal in the sense that it was based on an illegal consideration; that the work was capable of being performed in a legal manner; that the “alleged illegal acts entered neither into the promise nor into the consideration”; and that although the contract was performed in an illegal way, it was not necessarily illegal.
The Appellate Division took the position that there was no evidence of the happening of any of the dangers or evils *325which G. L. c. 148 was intended to guard against; that the work having been completed, there was no possibility of damage or the happening of any evil which the statute sought to prevent; and that the trial judge properly ruled that the failure to obtain the bond and permit was “only an incidental part of the performance of the contract,” citing Hawes Elec. Co. v. Angell, 332 Mass. 190, 191-192. But in that case, with reference to the installation of an oil burner, it was said, at pages 191-192, “Clearly the plaintiff violated the regulations by failing to obtain any permit for installation or to furnish any certificate of completion. Therefore the plaintiff cannot recover for its services in installation. Tocci v. Lembo, 325 Mass. 707. And if the contract was an entire one for burner and installation, a violation of the regulations as to installation will prevent the plaintiff from recovering anything on the entire contract, at least ‘if the illegality is serious or more than an incidental part of the performance.’ Williston, Contracts (Rev. ed. 1938) § 1761.” Whether “the illegality is serious or more than an incidental part of the performance” is a question of law. Hawes Elec. Co. v. Angell, supra, 191-192. Although phrased in terms of illegality, the decision may be supported on the ground that there was a failure of performance on the part of the plaintiff, in that he did not furnish a certificate of completion.
In Tocci v. Lembo, 325 Mass. 707, which was cited by neither the trial judge nor the Appellate Division, it was held that a builder could not recover for the performance of a lawful contract with a landowner where a dwelling house was erected in violation of Federal regulations without obtaining from the housing authorities authorization for such construction or the necessary “priorities” for the materials used. The opinion states (p. 709) that no case had been found in this Commonwealth in which recovery was barred because the illegality was not in the contract but in its performance. That case may be supported on the ground that there was a strong public policy against unauthorized building operations interfering with the Veterans’ Emergency Housing Program.
*326We do not reach the conclusion that blasting without complying with the requirements of a bond and a permit is so repugnant to public policy that the defendant should receive a gift of the plaintiff’s services. The defendant received all to which he was entitled under his contract. We think that this case falls within Fox v. Rogers, 171 Mass. 546, which was an action to recover for labor and materials furnished in laying a drain. The pipes laid were not those required by statute. In upholding a finding of the trial judge for the plaintiff, Holmes, J., speaking for a majority of the court, said at p. 547: “We shall not trouble ourselves about the construction of the statute and ordinances, because it does not follow that the plaintiff cannot recover if he broke them. There is no policy of law against the plaintiff’s recovery unless his contract was illegal, and a contract is not necessarily illegal because it is carried out in an illegal way. Barry v. Capen, 151 Mass. 99, 100. The judge was warranted in finding that the defendant employed the plaintiff to build a suitable drain, and left all details to the plaintiff’s discretion, simply promising to pay for the job when finished in consideration of the plaintiff’s promise to do it, — a contract lawful on both sides. . . . The supposed illegal acts entered neither into the promise nor into the consideration. It was not necessary to prove them even for the purpose of showing that the drain was finished, and that the time for payment had arrived.” Of Fox v. Rogers, it was said in Tocci v. Lembo (p. 709): “[C] The violation of the statute was only incidental to the performance of the contract and but a doubtful question of public policy was involved. [2] The opinion may be supported on the failure of the defendant to plead illegality.” On further consideration we adhere to the first sentence quoted, but are no longer able to subscribe to the second sentence quoted. We think that the opinion in Fox v. Rogers was rested upon the broad grounds stated in it. We should point out that the defendant there might have had some success in relying upon failure of performance, as in our present view of Hawes Elec. Co. v. Angell, had that question been raised. See Fox v. Rogers, *327supra, 547, where it was said, “It may be that if the pipes are not of the material required by law, they are liable to be taken up, or that in some way the fact might affect the amount of the plaintiff’s recovery, if that question were before us.”
In many cases relied upon by the defendant the contract as made contemplated an illegal performance. Wheeler v. Russell, 17 Mass. 258. Allen v. Hawks, 13 Pick. 79. Eaton v. Kegan, 114 Mass. 433. Somers v. Commercial Fin. Corp. 245 Mass. 286. Fouquette v. Millette, 310 Mass. 351.
Order dismissing report affirmed.