'SULLIVAN, C. J.
This is an action to recover possession of a certain right of way for an irrigating ditch in Ada county, on which is situated an uncompleted canal. It is alleged in the ■complaint that on the eighteenth day of January, 1896, one Eagleson located a water right, the water appropriated thereby to be used in the irrigation of certain lands therein described, and that a notice thereof was duly posted on the south bank of Boise river, about one mile above what is known as the “New Tork dam site,” and nearly opposite the mouth of Sheep gulch, in Ada county (that being the place of intended diversion), whereby he claimed the waters of said river, to the amount of three hundred cubic feet per second; that within the time re-' quired by law a copy of said notice was filed for record in the recorder’s office of Ada eouffiw, and a duplicate copy thereof in the office of the state engineer; that said Eagleson, who is desig*795nated “promoter” in trust for the plaintiff corporation thereafter tc be formed, began, within sixty days after posting said notice, to construct a canal, by surveying, laying out, and staking off a right of way. Then follows a description of said right •of way, which substantially covers the right of way claimed by the defendant corporation, and commonly known and designated as the “New York Canal Eight of Way.” It is also alleged that Eagleson, after said eighteenth day of January, 1896, became and was in the lawful and undisputed possession of said right of way, and proceeded with diligence in the construction of a ditch thereon; that thereafter, on the tenth day of February, 1896, said Eagleson, together with others, organized the corporation plaintiff and appellant, and that on the 29th of February said Eagleson conveyed to said corporation all of the rights he had acquired in and to said water right and right of way ; that thereupon the plaintiff corporation took possession of said right of way, and diligently proceeded with the construction of a canal upon said right of way; that, while the plaintiff was such owner and in possession of said right of way, the defendant corporation, on or about the twentieth day of April, 1896, willfully and maliciously, .with force and violence, and, without right or title, drove the plaintiff, its agents and employees, therefrom, and took possession of said right of way, except that part situated between the point where the said notice of location of water right was posted and the point commonly known as the “New York dam site,” and ever since has withheld, and still withholds/possession thereof; that defendant has committed waste on said right of way, to plaintiff’s damage in the sum of $1,000. The second cause of action set up in the complaint is equitable in its nature, and under it a temporary injunction was granted. Plaintiff prays judgment for possession of said right of way, and for $2,000 damages, and for an injunction. The defendant makes an answer, and files a cross-complaint. In them are set forth a brief history of the organization of the Idaho Mining and Irrigation Company; its ownership of certain water rights, and the greater portion of the right of way described in the complaint; the operations of said company, and its expenditure of about $300,000 upon said right *796of way, in surveying and constructing a very large canal, about, six miles in length, which resulted in the insolvency of said company, and a large indebtedness to one W. C. Bradbury for-constructing said canal; the purchase of said canal, right of way,, and water rights of said company by said Bradbury at sheriff’s-sale — and alleges the organization of the defendant corporation, and the sale and transfer to it by Bradbury of said canal and right of way, and the work done by said defendant company thereon since its purchase thereof. The trial was by the court, without a jury, and judgment was rendered in favor of' the plaintiff for the recovery of that part of the right of way situated above the said New York dam site; and it rendered judgment in favor of the defendant for the remainder of said right of way, or that below said dam site. A motion for a new trial was interposed by the appellant, and denied by the court. The appeal is from the judgment, and an order overruling- the-motion for a new trial.
This appeal involves the right to the possession and ownership of that portion of said right of way below said dam site, no-appeal having been taken from the judgment awarding that part of said right of way above said dam site to the appellant. It appears from the record that one Eagleson located a water-right on Boise river on January 18, 1896, with a view of diverting the water by means of a canal, and surveyed a right of way therefor, which right of way was substantially the same as the right of way hereinafter referred to as the “New York canal and right of way” (the intention being to appropriate said-right of way), and the uncompleted canal situated thereon;, that thereafter, on the 10th of February, 1896, said Eagleson, with others, organized the corporation plaintiff, and on the twenty-ninth day of February, 1896, conveyed whatever title he had acquired to said right of way and water right to said corporation; that thereupon said corporation began the construction of a canal on said right of way; that on about April 20, 1896, the defendant corporation, through its agents and employees, drove the agents and employees of the plaintiff corporation therefrom, and took possession thereof for the defendant, except that portion situated above said New York dam site. It further ap*797pears tbat some time prior to tbe year 1890 tbe Idaho Mining and Irrigation Company, a corporation, bad planned a system of canals for diverting water from Boise river, and designated it tbe “New York canal system.” Tbat system, aside from necessary laterals, consisted of the Main canal and tbe Phylis canal. The latter was taken ont of Boise river about fourteen miles below Boise City, was about thirty-seven miles in length, and bad a capacity of about three hundred cubic feet of water per second, and was completed to Snake river in June, 1890. The Main Canal was designed to be taken out in the canyon some miles above Boise City, and was to be constructed forty feet wide on the bottom, and to carry twelve feet in depth of water. The Main canal was known as the “New York canal,” and the record shows that the water from it was to have been distributed by a system of laterals. The Phylis canal was to he supplied with water partly from Boise river, and partly by taking up the waste water from said Main canal. The Phylis canal has been in use since its completion in 1890. . Work was begun on the New York canal in 1890, and up to April, 1891, the company had expended $300,000 in its construction, completing a section six miles in length, when the company became insolvent, and was owing to the contractor, W. C. Bradbury, who constructed said work, a large sum of money. Thereupon Bradbury filed a lien, under the laws of this state, upon the right of way and canal in controversy, and also upon the -Phylis canal, which lien was foreclosed, and said rights of way and canal sold at sheriff's sale to said Bradbury, who thereafter obtained a sheriff's deed to the same, February 8, 1894; said Bradbury thus became the owner of said canal system, and of all rights, interests, and privileges theretofore held and owned by said Idaho Mining and Irrigation Company. It appears that an association, composed of many farmers, began negotiation in January, 1896, with Bradbury for the purchase of said New York canal. Said association was thereafter merged in the defendant company, the Farmers' Canal Company, Limited, which company was incorporated in March, 1896. About one hundred and seventy-five farmers became stockholders in said corporation. As a result of said negotiations, said company took possession of said canal on *798February 21, 1896, on which day a deed and contract were drawn between Bradbury and said, company; but said deed was not delivered until April 10, 1896. It appears that W. W. Lynch, I. N. Hall, and others, located a water right on Boise river, January 24, 1896, at the mouth of the canyon above referred to, which right they thereafter conveyed to the defendant company. After defendant took possession of said canal as aforesaid, it caused the right of way below the mouth of said canyon to be resurveyed and cross-sectioned, and began work, and expended in cash and labor on said canal about $2,500, up to February, 1897. It appears that the plaintiff (the appellant company) had procured an injunction on June 6, 1896, against the defendant company, whereby said company was restrained from interfering in any manner with the right of way for said canal in said canyon, above the point where the said Lynch and Hall water location was made. Thereafter the defendant company did no work above that point. It appears that some work had been done in said canyon by the New York Canal Company, which is another name for the Idaho Mining and Irrigation Company. After Bradbury had obtained title to said canal by sheriff's deed, it appears he procured surveys, plans, and estimates for a dam across Boise river at the lower end of said canyon, some two miles below the original head of the New York canal, with the avowed intention of raising water so as to use that portion of the New York canal that was completed, and also for the purpose of developing a water power, and later obtained a report upon the subject, with a view of interesting capital in the undertaking. In conveying said canal and right of way to the defendant corporation, Bradbury reserved the exclusive right to develop said water power, but conveyed to defendants two certain water rights, which are described in the deed from Bradbury to defendant, and will be hereinafter referred to as water rights located by Burns and Foote.
Numerous errors are assigned, but the main question for decision is, Did the defendant establish.a superior right to the possession of said right of way ?
The first contention of appellant is that an action to establish a right to the possession of a right of way on the public *799domain, over which to divert water, cannot be maintained unless the parties have first acquired a right to divert water; and it cites section 2339 of the Eevised Statutes of the United States. The respondent alleges in its cross-complaint that it procured by purchase, a water right from Bradbury; and if is contended by appellant that, as the defendant failed to prove that allegation, the right to the possession of said right of way cannot be. maintained. It must be remembered that, at the date of the location of the water right and right of way under which appellant claims, Bradbury was the owner of said right of way and partially completed canal; and conceding that, because of the delay in the construction of said canal, the water rights located by Barns and Foote had been forfeited, we do not think that worked a forfeiture of said uncompleted canal and right of way. At that time Bradbury was the owner of a water right consisting of three hundred feet per second of the waters of said Boise river, and was diverting said water through the Phylis canal, which was a part of said New York canal system, and of which system said New York canal was intended, when completed, as the main canal. That being true, had Bradbury retained the ownership of the canal and right of way in dispute, he could, on the completion of said canal, have diverted through it a part or all of the water that had been appropriated for diversion through said Phylis canal, and thus had a valid use for such canal, and a water right in connection therewith, or might have utilized said canal by water subsequently located and appropriated or purchased. The record does not show the slightest intention to abandon said right of way and canal, nor is there any proof of forfeiture. We are of the opinion that pos-sessory rights to ditches and to the use of water may each have an existence independent of the other. A ditch may be conveyed, reserving the water right, or the water right may be conveyed, reserving the ditch. (Clifford v. Larrien (Ariz.), 11 Pac. 397.) Ditches and water rights are real estate, under the provisions of section 2825 of the Revised Statutes. (See, also, Kinney on Irrigation, sec. 224; Reed v. Spicer, 27 Cal. 58.) In Welch v. Garrett, ante, p. 639, 51 Pac. 405, this court held “that a ditch constructed on unoccupied public lands of the *800United States is held by grant, and the owner of such ditch does not forfeit his right thereto by mere nonuser.” The plaintiff seeks to appropriate to its own use said canal and right of way, on the ground that its grantors had acquired a right to divert water, and had located a right of way for an irrigating ditch over and upon the right of way claimed by respondent, and places its claim on the ground that said last-named right of way had been forfeited or abandoned. Forfeiture or abandonment presupposes a prior valid right. Abandonment is a question of intention, and forfeitures are not favored, and must be clearly established. The record does not show abandonment, and we do not think the loss of the right to divert water under a specific location necessarily forfeits the right to an irrigation canal or right of way for one. It is not contended or claimed that appellant acquired title to said right of way and canal through prescription, or otherwise than by locating a right of way over it in January, 1896, at which time Bradbury was the owner and in possession thereof, and shortly thereafter sold the same to the defendant. In fact, negotiations were in progress between • Bradbury and the promoters of the defendant corporation for a sale and purchase of said canal and right of way at the time plaintiffs’ grantors made the alleged location.
The Lynch and Hall location had been made prior to the purchase of canal and right of way of Bradbury by defendant, and, although the defendant did not plead said Lynch and Hall water right in the trial of the ease, the court permitted its proof; and that is assigned as error. Section 4225 of the Revised Statutes provides that no variance between the- allegations in the pleadings and proof is deemed to be material unless it has actually misled the adverse party to his prejudice in maintaining his action or- defense upon its merits. Had an amendment been offered, setting forth the location and purchase of said water right, we think the court would have been warranted in allowing it; and, besides, we do not think that the variance referred to misled the plaintiff to his prejudice. Section 4231 of the Revised Statutes provides that, in every stage of an action, courts must disregard any error or defect in the pleadings or proceedings which does not affect the substantial *801rights of the parties, and that no judgment shall be reversed or affected by reason of such error or' defect. However, in our view of this case, it was not absolutely necessary for the defendant to show the purchase of said Lynch and Hall water right, to establish its right to the possession of the uncompleted canal and right of way in dispute. The Idaho Mining and Irrigation Company had expended three or four hundred thousand dollars in attempting to complete said New York canal system, and became insolvent. The contractor, Bradbury, was a large creditor, and had done much of the work in constructing said system, and had to take the same in payment of such indebtedness. It appears that he was unable to complete said system, and sold said right of way and uncompleted canal to the defendant corporation, composed of a large number of farmers, who own land that may be irrigated from said canal extended. Hnder the facts of this case, it would be repugnant to every principle of justice and equity, and would result in confiscation, to hold that plaintiff became the owner of said uncompleted canal and right of way, and was entitled to the possession thereof. We are of the opinion that Bradbury had not forfeited said •canal and right of way, that he had a lawful right to sell and convey the same to the respondent, that he did so, and that respondent is the owner of said right of way, and entitled to the possession of the same. The judgment of the court below must be affirmed, and it is so ordered, with costs in favor of respondent.
Huston and Quarles, JJ., concur.