That the illegality of a contract is in general a perfect defence, must be too obvious to need illustration. It may, indeed, * be regarded as an impossibility by act of law; and it is put on the same footing as an impossibility by act of God; because it would be absurd for the law to punish a man for not doing, or, in other words, to require him to do, that which it for* bids his doing.

Therefore, if one agrees to do a thing which it is lawful for him to do, and it becomes unlawful by an act of the legislature, the act avoids the promise; and so if one agrees not to do that which he may lawfully abstain from doing, but a subsequent act requires him to do it, this act also avoids the agreement. (l)

(k) Thus, in Faulkner v. Lowe, 2 Exch. 695, there was a covenant by G to pay a sum of money to A, B, and to himself C, or the survivors or survivor of them, on their joint account. C being sued upon this covenant, the court held the covenant senseless and impossible, and judgment was given for the defendant

(kk) Tome v. Doelger, 6 Rob. 261.

(l) Presb. Church v. City of N. York, 6 Cowen, 638. In that case the corporation of the city of New York conveyed lands for the purposes of a church and cemetery, with a covenant for a quiet enjoyment, and afterwards, pursuant to a power granted by the legislature, passed a by-law prohibiting the use of these lands as a cemetery; held, that this was not a breach of the covenant which entitled to damages, but it was a repeal of the covenant And Savage, C. J., thus remarked upon the authorities: "There are but few authorities on this question, and those few are at variance. The case of Brason v. Dean, 3 Mod. 89, decided in 1683, was covenant upon a charter-party for the freight of a ship. The defendant pleaded that the ship was loaded with French goods, prohibited by law to be imported. And upon demurrer judgment was given for the plaintiff, for the court were all of opinion, that if the thing to be done was lawful at the time when the defendant entered into the covenant, though it was afterwards prohibited by act of parliament, yet the covenant was binding. But in the case of Brewster v. Kitchin, 1 Ld. Raym. 317, 321, a. d. 1008, a different and a more rational doctrine is established. It is there said : ' For the difference when an act of parliament will amount to a repeal of a covenant and when not, is this: when a man covenants not to do a thing which was lawful for him to do, and an act of parliament comes after and compels him to do it, then the act repeals the covenant; and vice versa. But when a man covenants not to do a thing which was unlawful at the time of the covenant, and afterwards an act should do nothing. (n)l And this excuse is valid, although the omission by the other party to do the thing required of him, was produced by causes which he could neither foresee nor control. And if it is provided that the thing shall be done "unless prevented by unavoidable accident," the accident to excuse the not doing, must be not only unavoidable, * but must render the act physically impossible, and not merely unprofitable and inexpedient by reason of an increase of labor and cost. (o)

But if one agrees to do what is at the time unlawful, a subsequent act making the act lawful, cannot give validity to the agreement, because it was void at its beginning. A law may, however, have the effect of suspending an agreement that was originally valid, and which it makes impossible without violation of law; and yet leave the contract so far subsisting, that upon a repeal of the law the force and obligation of the contract remain. (m) It would seem that a* prevention by the law of a foreign country is no excuse, because this does not make the act unlawful in the view of the law which determines the obligation of the contract. The subject of illegal contracts is again considered in a subsequent section of this chapter.