This is an application for a writ of certiorari, to bring before this court certain proceedings had in the court of common pleas, upon the petition of the present respondents, praying that damages might be awarded to them under the provisions of the statute for the erection and regulation of mills, (Rev. Sts. c. 116.) with a view of quashing those proceedings, as irregular and erroneous.
*607This application being one addressed to the sound discretion of the court, and -not to be granted where the errors assigned are only matters of form, and where no substantial injustice has been done, the court will not, as a matter of course, grant the writ of certiorari, especially where the party has, as in the present instance, neglected to invoke the aid of the court in his behalf, until after the lapse of some considerable time since the making of the adjudication complained of. But, on the other hand, if the proceedings were wholly unauthorized by law ; if the errors complained of be matters of substance, and not of form ; if the objection taken to the validity of the proceedings be one which goes to the merits of the case, and presents objections which could not have been obviated if taken earlier; and especially where the judgment, if unreversed, may be the foundation of further onerous proceedings against the party aggrieved by the error complained of, it would become our duty to grant the writ, and to vacate the judgment, upon the return of the writ of certiorari.
We have examined the case before us, under this view of the law as to the nature of the judicial discretion to be exercised in this matter. So far as the objection is taken to the want of a formal allegation, in the complaint, that the dam was erected to raise water for a water mill, although this may not be directly alleged, yet we should think that no sufficient ground was shown, as arising from this objection, to require us to grant a writ of certiorari. The provisions of the Rev. Sts. c. 116, § 1, are, that “ any person may erect and maintain a water mill, and a dam to raise water for working it, upon and across any stream not navigable, subject to the regulations hereinafter expressed.”
The allegation in the complaint, that the water is to be raised by a dam for the purpose of building a mill thereon, strongly implies that the mill to be built is to be a water mill, and so far brings the case within the statute. But passing over this and other objections of like character, which might be considered matters of form, we come to the great question in the case, and that which is prominently put forth by the petitioner as the ground for quashing the proceedings of the court of common *608pleas. The effect of the judgment complained of was to assess upon Stephen Stevens, the respondent in the original complaint, a large sum in damages, for flowing the lands of the present respondents. The authority for sustaining this judgment rests wholly on statutory provisions, and must be found there, if it exist at all. The statute enactments are contained in Rev Sts. c. 116. The leading objects of these enactments are the encouragement of mills, by giving the right to flow the adjacent lands, and the providing of adequate compensation to the owners of the lands thus flowed. The right to flow, however, is attached to a mill and the dam to raise water for working. it, and does not embrace the case of a dam erected independently of a mill. The statute would furnish no defence to an action at common law against one who should erect a dam without a mill, and flow the adjacent land. The foundation, therefore, of proceedings under the statute, to recover damages for flowing lands, must rest upon the existence of those facts which bring the parties under the operation of the mill act. As we have already suggested, the mill is the principal and the dam the incident; the former is the real object of protection, the latter only as subservient to the former. Hence the party who would justify flowing the lands of another, or the party who seeks to have damages awarded him under the mill act, must set forth a case showing not only the erection of a dam, but also that such dam is connected with a water mill, either actually existing, or in the process of construction ; which latter term will embrace the case of a present purpose forthwith to erect a mill in connexion with the dam.
But there must be the actual erection of a mill, or a purpose forthwith to erect one. This precise point seems to have been decided in the case of Fitch v. Stevens, 4 Met. 426, arising out of the same .proceeding, and where one of the parties was the same as in the present case. The rule, as there declared, was in accordance with the doctrine above stated. It was said, in the opinion of the court given in that case, that “ there must be coupled with such erection the building of a mill for use, or there must exist the intent, which shall be capable of proof, *609forthwith to erect one.” Again ; speaking of the proceedings upon the same complaint that is now before us, it was said, “ we are of opinion that this complaint for flowing was prematurely brought.” “We come to the conclusion, therefore, that Stephen Stevens was not liable, at the time of the filing of the original complaint, to be proceeded against under the statute; and that if he had pleaded in bar to the process, he would, under the facts as now presented, have prevailed in his defence.” This opinion seems to be decisive upon the merits of the present case, and sustains the proposition, contended for by the petitioner, that the original complaint was defective in a material allegation, without which the case was not within the provisions of the mill act.
The only point open to the present respondents, therefore, seems to be that connected with the peculiar character of the present application, as one addressed to the sound discretion of the court. As has already been stated, this application is not granted as a matter of absolute right. It will be refused where the defect relied on is mere matter of form, and no substantial injury has been done to the party complaining, or where the party has, by reason of laches in not taking the objection at an earlier stage, permitted the adverse party to make large expenditures, for objects beneficial to the party seeking to quash the proceedings. The objection, here relied upon by the petitioner, does not fall within either class of the cases alluded to. The objection to the complaint is a substantial one, and may be properly urged at this late stage of the proceedings. ■ It alleges, and the fact is, that the original complainants had no such case as would warrant an adjudication assessing damages against the respondent in that complaint, in a large sum, and which, if liable to the process, he might be compelled to pay. In the opinion of the court, the petitioner is entitled to his writ of certiorari.