It is not intended by the St. of 1873, c. 353, § 1, under which this action is brought, that a party who does work for one who had contracted with a railroad corporation previously to the passage of the act, or for his sub-contractor also contracting previously, shall be enabled to maintain an action against the corporation for the work which he thus does, even if it is actually contracted for and performed subsequently to the passage of the *582act. The corporation must pay those with whom it contracted according to the terms of its obligations as made at the time of the contract; from these it is not to be released; and on the other hand it is not to be afterwards exposed to a liability which it did not then incur. In contracts made after the passage of the statute, as all parties have legal knowledge of it, they are presumed to have full regard to it in any obligations upon which they may enter.
Nor can the construction contended for by the plaintiff be supported upon the ground that the act, so far as it enables the plaintiff to sue the corporation for the work done for its contractor or sub-contractor, affects his remedy only. It gives him a new and distinct right and exposes the corporation to a new liability.
The reasons upon which it was held in Donahy v. Clapp, 12 Cush. 440, that payment for labor performed under a contract with a person employed by the owner of land to erect a building thereon could not be secured by a lien on said land under the St. of 1851, o. 343, if the contract with the landowner for the erection of the building was made before that statute took effect, even if the contract for the labor was made and the labor actually performed after the statute was in full force, apply directly to the case before us. Judgment affirmed.