delivered the opinion of the court.
From the foregoing statement it will be seen that the controversy here is between a purchaser under the foreclosure of a trust deed containing a provision covering subsequently acquired property, and those claiming liens under the mechanic’s lien statute of the state, whose rights accrued after the recording of the prior trust deed, on account of labor performed and materials furnished, which were wrought into, and thus combined brought into being, such property. The contractor makes no defense, and the only question involved is the relative priority of the trust deed and of the mechanics’ liens.
The first position of the appellants is that the right of way upon which this flume was built became vested in the Canal Company when the latter filed its map, etc., in July, 1889. This right of way, it is said, was in esse, and covered by the trust deed long before the lien of the appellees attached. The argument is that under the act of congress of July 26, 1866 (Rev. Stats. U. S., secs. 2339, 2340), this right of way, being over government land, was confirmed to the Canal Company “ as the same is recognized and acknowledged by the local customs, laws,” etc., citing Jennison v. Kirk, 98 U. S. 453, Broder v. Water Co., 101 U. S. 274, and other similar cases.
By section 1720, General Statutes 1883, as amended in 1887 (see Session Laws of 1887, p. 314), relating to the rights of those who build ditches and canals and appropriate waters of natural streams for purposes of irrigation-, it is pro*314vided that the “ priority of right of way, and water accordingly, shall date from the daynamed as the day of commencing work, otherwise, only from the date of the filing of the same that is, from the day of filing the map, statement, etc. Hence, it is said, this right of way became vested as against the government, the owner of the servient land, from the day when the map, etc., were filed.
This we regard as not a correct construction of the statute. The priority given, both as to the right of way and the water, is as against other claimants of ditches and canals and appropriators of water from the same source of supply. The language is general, and is as applicable to a private individual as to the federal government over whose lands the ditch is built. But we apprehend it would not be contended that a right of way over the lands of a private individual, acquired by a canal owner for conveying water in his canal, became vested and fixed from the time of beginning work on the canal, but only from the time the right of way itself was purchased or conveyed. So, also, where the right of way comes by operation of the grant contained in this act of congress. It becomes vested only upon a compliance on the part of the canal owner with the local laws, customs, etc., and ownership is acquired as the work progresses, and the priority to the water, as well as the right of way, becomes vested only upon the completion of the work of construction, and the application of the water to a beneficial use.
Then, it is true, the right in both cases relates back as of the date when the work was begun, but this is only as against other appropriators of water from the same stream; provided, also, the filing of the statement be made in the office of the state engineer, which was not done, as well as in the office of the county clerk and recorder, which latter was done. Hence, we conclude that the right of way of this canal did not become vested before the canal was finished, though it attached as fast as the ditch was constructed. The most that can be claimed, which we might concede, is that the acquisition of the right of way and the attaching of the me*315chanic’s lien are contemporaneous. Carland v. Irrigation Co., 9 Utah, 350.
If, however, it could be held that this right of way became vested when the Canal Company filed its map and statement, under the evidence, and in accordance with the findings of the court, this flume was an entire structure and improvement, and when completed, though part of the general system of canals, was entirely disconnected and separate at both ends from other portions of the canal which had theretofore been constructed. This being true, in accordance with the provisions of section 2148, General Statutes of 1883, even though such right of way was included in the prior mortgage and the mortgage attached to the same before the appellees’ lien attached, nevertheless the liens of the latter, as to the flume itself, have priority. Such legislation as this has repeatedly been held constitutional. See Phillips on Mechanics’ Liens (3d ed.), sec. 238; Brooks v. Railway Co., 101 U. S. 443; Newark L. & C. Co. v. Morrison, 13 N. J. Eq. 133; Creer v. Canal Co., (Idaho) 38 Pac. Rep. 653.
As we understand the claim of appellants, it is that the right asserted is founde.d upon the provisions of section 1720, supra, and the amendments thereto. This contention assumes the validity of the statute, as to which we express no opinion, for that question is not before us. But if the right does so depend, a compliance with the provisions of the statute must be shown. The record, however, contains no evidence that the filings required were made with the state engineer. Such compliance not being shown, the right, if it rests upon the statute, is not established.
The next contention of the appellants, in a measure inconsistent, it may be said, with the first, is that the Canal Company did not own the land, or any interest therein, when the appellees began to do work and furnish materials for the flume thereupon built. A sufficient answer to this is that the statute gives a lien upon whatever interest the owner had when the work was begun, and to another or greater interest whenever acquired before the lien is enforced; and any person *316having an assignable, transferable or conveyable interest or claim in or to any land, etc., shall be deemed an owner. Certainly the Canal Company had a possessory right or interest in this land at the time of the beginning of the work which was the subject of transfer; and whatever right it did have, inchoate and equitable, became absolute by the subsequent doing of this very work, and the furnishing of these materials, by the appellees. Garland v. Irrigation Co., supra.
The third contention is that A. S. Baker, the contractor of the Canal Company, by express contract with the owner to that effect, waived his right to file a lien under the mechanic’s lien act, and that the subcontractors are bound to know the terms of this contract, and they can claim no lien because their contractor waived it. To this effect we are cited, among others, to the following cases: Bowen v. Aubrey, 22 Cal. 566; Dersheimer v. Maloney, 22 Atl. Rep. 813; Tebay v. Kirkpatrick, 23 Atl. Rep. 318; Phillips on Mechanics’ Liens (3d ed.), secs. 117, 58, 62. Other cases holding the same doctrine are: Nice v. Walker, 25 Atl. Rep. 1065; Schroeder v. Galland, 19 Atl. Rep. 632; McElroy v. Braden, 152 Pa. St. 78.
Under the lien law of this state, which, as it is claimed, gives to a subcontractor an independent and distinct lien, irrespective of the right of the contractor thereto, — being, as it is argued, a creature of the statute, and not of contract,— there may be a question whether or not a contractor may, merely by his contract with the owner waiving his right to a lien, cut off the right of a subcontractor thereto. There are decisions holding — at least intimating — that the statutory rights of a subcontractor cannot thus be destroyed. Clough v. McDonald, 18 Kan. 114; Chicago Lumber Co. v. Woodside, 71 Iowa, 359; Lonkey v. Cook, 15 Nev. 58; Gull River L. Co. v. Keefe, 41 N. W. Rep. (Dak.) 743; Albright v. Smith, 51 N. W. Rep. (S. D.) 590; Laird v. Moonan, 32 Minn. 358; Hall v. Mullanphy Planing Mill Co., 16 Mo. App. 454.
But we have not such a case before us, notwithstanding the insistance of the appellants to the contrary, and we ex*317press no opinion as to the power of a contractor, under our statute, to waive a subcontractor’s right to file a lien. The contract here between the owner and the contractor must be taken in its entirety. While the owner is not here insisting that the subcontractor has no right to file a lien, the purchaser at the sale under the prior trust deed is in a position to question and attack the validity of the liens of appellees.
The waiver of this statutory right must clearly appear either by express agreement to that effect, or by necessary implication from the language of the contract. Evans v. Grogan., 25 Atl. Rep. 804; Taylor v. Williams, 23 Atl. Rep. 1134. If there is any doubt about the meaning of the contract, the construction which the parties thereto themselves put upon it may be resorted to by the court, and of this the prior mortgagee or purchaser at the sale under the incumbrance cannot complain. These different provisions of the contract quoted in the statement, taken together, show that the fight to file a lien, certainly by the subcontractor, was not waived or lost. The most that can be said is that by implication from the language used the contractor himself agreed not to file a lien for himself, and the first sentence of the first provision quoted, if it stood alone, might be so construed; but it is immediately followed by an agreement upon the part of the contractor to warrant and defend the owner against all liens that may accrue in favor of subcontractors and material men, thus recognizing that such liens of subcontractors might accrue and be filed, and be binding against the owner, and thus indicating that the limitation as to filing liens was intended to apply, if to any one, only to the contractor. That the owner so considered is evident from the precaution which it took to insert in the contract as a security against liens that no payments could be required of it until all bills for labor done and materials furnished for the canal should be presented to it by the contractor on the first of the month succeeding that in which the work was done and materials furnished, duly receipted and paid, and that the amounts *318thereof should be chai’ged against the contractor upon his account with the owner.
If the contractor waived the lien as to subcontractors, why the necessity of requiring receipted bills from them before the owner paid the contractor? As if to make still more emphatic this understanding, and still further to protect the owner against liens that might be filed by the subcontractors, a bond, saving harmless the owner from all labor bills, was given to it by the contractor. It is clear to us that it never was intended either by the contractor or the owner that the subcontractors might not file a lien as security for the payment of their claims.
Conceding that the flume and the right of way are property acquired subsequent to the execution of the trust deed, it is further contended that as soon as they came into being the lien of the mortgage attached to them free from the lien of these subcontractors. That subsequently acquired property maj'’ become subject to the lien of a mortgage, if apt words covering it are inserted in that instrument, is well settled, especially in the federal courts; and such lien attaches when the property comés into being, and, in general, is superior to any subsequent incumbrance. See Jones on Mortgages (5th ed.), sec. 149, and cases cited.
It is, however, equally well settled that “the mortgage attaches to the property in the condition in which it comes into the mortgagor’s hands.” “ Thus a mechanic’s lien for work done and materials furnished on such after-acquired property takes precedence of the mortgage.” 1 Jones on Mortgages, sec. 158; Phillips on Mechanics’ Liens, sec. 242; Williamson v. N. J. Southern R. R. Co., 28 N. J. Eq. 277, 29 N. J. Eq. 311; United States v. New Orleans R. R. Co., 12 Wall. 362; Hall v. Planing Mill Co., supra.
This flume and the right of way, as has been said, were brought into being — were created — by the work which was done and the materials which were furnished by the appellees, for which they now claim these liens. At the very moment these improvements — this property — thus came into *319the hands of the Canal Company, the mortgagor, the right of the appellees to file liens attached, and subject thereto, the property passed under the provisions of the mortgage. Most inequitable would it be to hold that the property, which owes its very existence to the labor done and materials furnished for which liens are claimed, should pass under the control of the mortgage, free from these liens.
The evidence is, and the trial court must have so found, that this flume was an entire and'independent improvement, and, in addition to the reasons which have already been given, if the improvement was a separate and entire structure, the lien of the appellees as to the flume itself would, under our statute above referred to, take precedence of the prior trust deed, and it might be removed from the land after a sale upon an execution.
The only other point pressed in argument is that as the contractor failed to perform his contract, no right to a lien, either of the contractor or subcontractor, exists. To this it is sufficient to say that the assumption is not borne out by the evidence, but is contrary thereto. But, if true, the subcontractors, under the. facts of the case, are entitled to what the work done and the materials furnished are reasonably worth, after deducting any claims for damages for the alleged nonperformance by the contractor, and we must uphold the findings of the trial court in this particular. Morehouse v. Moulding, 74 Ill. 322; Wright v. Roberts, 43 Hun, 413; Whittier, Fuller & Co. v. Blakely, 13 Ore. 546.
Upon the whole case, we think the judgment should be affirmed, and it is so ordered.
Affirmed.