The opinion of the Court was delivered by
Gibson, C. J.
By the primitive act of 1803, supplied by the act of 1806, on which, with the supplement of 1808, the present question depends, the legislature hypothecated buildings for debts contracted in the construction of them. No more was contemplated in it than the usual case of a builder on his own ground; and hence, in an action against the legal owner, a lien was not allowed for materials furnished on the order of a vendee, by articles of agreement, because an action to enforce it could be maintained only on *11the contract by which the debt was incurred, and of which the lien was an accessory. Stinemetz v. Boudinot, 3 ¿¡erg. fy Rawle 541. The legislature had provided no means of enforcement but an action; and it could, of course, be maintained only against the contractor. Had it been brought against him in that instance, it would have raised a question like the present, but depending on different provisions; yet it might not have been impossible to maintain, even under the act of 1803, that an equitable vendee was an owner within the purview of it; That it would certainly have been so adjudged, I pretend not to assert; for the lien having been but an accessory of an inchoate estate, might readily have been postponed to the legal title; and I think it probable that a mechanic’s lien, like a judgment, would have bound only the equitable estate of the vendee. But the glimpse which the legislature then had of the subject, was barely sufficient for a sketch of its first lines; for it was soon found in the city of Philadelphia, and those districts of the county to which the primitive act was confined, that contracts for labour and materials were usually made, not by owners building for themselves, but by architects employed to build and contract on their own credit. Hence a radical change in the principle of hypothecation by the act of 1806. The lien was no longer an accessor^ of the owner’s title, but became an independent incumbrance; insomuch as not to require a title to have been in him at all. Every thing about ownership was suppressed, and the building itself became the principal debtor, but still answerable only by an action against the contractor. Then came the supplement of 1808, which gave, in addition, a scire facias, jointly against the owner and the contractor; and strictly as a proceeding in rem. As was recognised in Savoy v. Jones, 2 Rawle 343, the credit, under these two acts, was primarily given to the building; and though the builder, also, was liable on his contract, the action, so far as it was used to enforce the lien, was also a proceeding in rem. It is entirely omitted in the act of 1836, which has superseded all antecedent legislation on the subject. But the project of the legislature, in the preceding acts, has been, as it still is, t.o secure to the mechanic, or material-man, the fruit of his labour or materials, by selling the building, of which it happened to be a component part, without regard to the ground. The latter was a subject of so little consideration as not to have been mentioned in either of them; and that it is sold as an appurtenance of the building, is because it could not be severed from it. But where the building and the ground fetch, as they must generally do, more than the amount of the liens, I see not what difficulty there can be, according to an obvious principle of equitable conversion, in substituting the surplus purchase money for the realty which produced it, and giving it respectively to the owners of the fee in proportion to their interests in it. By this, there can seldom be a loss, and never an injustice; for the question is, whether the building shall follow the ownership of the ground, or the ground follow the owner*12ship of the building. If decided for the claimant, the owner will, in most cases, be paid for his ground ; but if for the owner, he will, in all cases, get the benefit of another’s uncompensated labour or materials in addition to it. Were the building sold without the ground, the interests in the freehold would not be disturbed; but as that is impracticable, a consequent loss may sometimes have to be shared by claimants, under the same title, of separate interests in the fee. It may be, however, that an adverse title would not be affected. A trespasser, in possession, is not allowed to charge the owner for adverse improvements; and it may not have been the design of the legislature to give a greater power to agents in his employment, who are also trespassers. On that, however, we express no opinion; but as the plaintiff claims by a title which was subsequently hypothecated, we are of opinion he can claim only in subjection to the liens, and not at all against a purchaser under them.
Judgment reversed.