I concur. Although I believe it is a close question, I agree with the majority that Civil Code section 1717 applies in this matter to bar recovery of attorney fees for defending contract claims after voluntary dismissal. I am persuaded that Civil Code section 1717 applies without regard to whether the attorney fee provision is drafted as a nonreciprocal or reciprocal agreement, based on the statute’s reference to “any action on a contract, where the contract specifically provides that attorney’s fees and costs . . . shall be awarded either to one of the parties or to the prevailing party . . . .” (Ibid., italics added.)
As the majority observe, in providing that “[wjhere an action has been voluntarily dismissed . . . , there shall be no prevailing party for the purposes of this section . . . .” Civil Code section 1717 effectively codified the majority decision in International Industries, Inc. v. Olen (1978) 21 Cal.3d 218 [145 Cal.Rptr. 691, 577 P.2d 1031], from which I dissented (id. at pp. 225-226 (dis. opn. by Mosk, J.)). Olen held, in my view incorrectly, that public policy and equitable considerations precluded recovery of attorney fees based on contract when the plaintiff voluntarily dismisses an action prior to trial. As the majority also observe, however, the Legislature subsequently enacted provisions at least suggesting that it does not view contractual attorney fee costs in the case of a voluntary pretrial dismissal as necessarily or invariably against public policy. (Maj. opn., ante, at p. 621.) Thus, Code of Civil Procedure section 1032 defines “prevailing party” for the purposes of costs as including a party in whose favor a dismissal has been entered, and the 1990 amendment of Code of Civil Procedure section 1033.5 defines awardable costs as including attorney fees authorized by contract.
The apparent inconsistency on this point of public policy between the Civil Code section 1717 and Code of Civil Procedure sections 1032 and *6241033.5 indicates the need for legislative reconsideration of the underlying question: Is an award of attorney fees fair for the party who prevails not in a trial but by virtue of his opponent’s voluntary dismissal? In my view, the answer is affirmative.
It is true that counsel was not required to participate in the travail of a contested trial, with all of its time-consuming complexities and uncertainties. Nevertheless the attorney whose client is the beneficiary of a dismissal has necessarily interviewed the client perhaps numerous times, may have sought witnesses, prepared pleadings, perhaps taken depositions and, in short, performed many or all of the preparations in anticipation of a contested trial. Although the trial did not materialize, substantial attorney services may have been performed and the desired result has prevailed.
Therefore I see no basic unfairness in an award .of attorney fees to the party whose position prevails in the absence of a formal trial.