(dissenting).
[¶ 38] I would reverse and remand for the trial court to consider and decide this case.
[¶ 39] 1. The Secretary is estopped from asserting the notice defense.
[¶40] The Secretary should be estopped from asserting Wolffs’ failure to comply with the notice statute seven years after the claim was filed and after lengthy discovery.
[¶ 41] The Secretary answered Wolffs’ complaint, filed motions, participated in hearings, and continued discovery from June 26, 1987 until September 29, 1994. This was affirmative conduct which “create[d] an objectively reasonable impression” in Wolffs that they had fully complied with the procedure. Smith v. Neville, 539 N.W.2d 679, 681 (S.D.1995). The Secretary should be es-topped from now claiming lack of notice. See Erickson v. Brookings County, 1996 SD 1 ¶ 15.
[¶ 42] “[A]n estoppel can be applied against public entities in exceptional circumstances to ‘prevent manifest injustice.’ ” Smith, 539 N.W.2d at 682 (citing City of Rapid City v. Hoogterp, 85 S.D. 176, 180, 179 N.W.2d 15, 17 (S.D.1970)). Wolffs have invested substantial time and expense in preparing their case.
Furthermore, mere innocent silence or inaction will not work an estoppel unless one remains silent when he has a duty to speak. Generally, to work an estoppel, there must be some intended deception in the conduct or declaration of the party to be estopped. The conduct must have induced the other party to alter his position or do that which he would not otherwise have done to his prejudice.
Smith, 539 N.W.2d at 682 (quoting Hanson v. Brookings Hosp., 469 N.W.2d 826, 828-29 (S.D.1991)(emphasis added)). SDCL 15-6-8(c) placed a duty on the Secretary to set forth affirmatively any matter constituting an avoidance or affirmative defense. Century 21 Associated Realty v. Hoffman, 503 N.W.2d 861, 865 (S.D.1993) (“A defendant has a duty to plead affirmative defenses and failure to do so would result in the defense being barred.”).
[¶ 43] The roadway was closed in May 1987. SDCL 3-21-2 provides that Wolffs had 180 days after the roadway was closed to provide notice to the Commissioner of Administration and the Attorney General. Wolffs’ complaint was filed in June 1987. The Secretary answered on July 30,1987. If the Secretary had included the notice provisions in its answer, there was time remaining for the Wolffs to notify the proper authorities of their claim. If the Secretary had notified Wolffs of their failure to comply with the notice statute at any time before September 1994, considerable costs could have been avoided by both parties. “While the State and its agents have no legal duty to gratuitously hand out legal advice on notice statutes, neither do they have the right under the statutes to affirmatively mislead.” Smith, 539 N.W.2d at 681-82.
[¶ 44] Generally, a party’s pleadings must affirmatively set forth affirmative defenses. Varga v. Woods, 381 N.W.2d 247, 251 (S.D.1986). “If such an affirmative defense is not pleaded, it is waived.” Id. (citation omitted). The majority contends the Secretary did not waive the defense of lack of notice because it was tried with the implied consent of the parties.
The test for allowing an amendment under SDCL 15-6-15(b) is whether the opposing party will be prejudiced by the amendment; i.e., did he have a fair opportunity to litigate the issue, and could he have offered any additional evidence if the case had been tried on the different issue.
Isakson v. Parris, 526 N.W.2d 733, 736 (S.D.1995) (emphasis omitted) (quoting Beyer v. Cordell, 420 N.W.2d 767, 769-70 (S.D.1988)).1 The majority states the Wolffs were not prej*539udiced because they did not file a response stating they were prejudiced after the motion to dismiss. However, the Wolffs were clearly prejudiced by expenditures for legal fees and depositions to prepare for the case.
[¶ 45] The provisions of SDCL ch. 3-21 were designed to provide notice to the State of South Dakota when it was named a party in a lawsuit. The reason for the rule has been met in this case. The Secretary answered Wolffs’ pleadings and was prepared to defend itself. Wolffs should be allowed a trial. “This should be done on the basis of the intent, meaning, and purpose of the statute since [Wolffs] complied with the underlying purpose of the notice requirement.” Sioux Valley Hosp. Ass’n. v. Tripp County, 404 N.W.2d 519, 523-524 (S.D.1987) (Sabers, J., dissenting). SDCL 3-21-2 “should be interpreted in the just and equitable manner for which it was intended, so that it fulfills its purpose and none other.” Id. The Secretary participated in the lawsuit for seven years without claiming a violation of the notice provisions. It should not now be allowed to fashion a sword of the shield provided by the notice statutes.
[¶ 46] 2. The Secretary is not entitled to summary judgment on the merits.
[¶ 47] After seven years, the Secretary made a motion to dismiss based on lack of notice. The trial court converted it to a summary judgment by considering evidence outside the pleadings.2 The trial court did so without notice to the parties as required by SDCL 15-6-12(b).3 We have clearly stated that such notice is mandatory. Eide v. E.I. Du Pont de Nemours & Co., 1996 SD 11 ¶ 5, 542 N.W.2d 769, 770; Norwest Bank Black Hills v. Credit Union, 433 N.W.2d 560, 562 (S.D.1988) (citing Schaub By Schaub v. Moerke, 338 N.W.2d 109, 110 (S.D.1983); Olson v. Molko, 86 S.D. 365, 195 N.W.2d 812 (1972)). If a motion to dismiss is treated as a motion for summary judgment, notice must be given and “all parties shall be given reasonable opporttmity to present all material made pertinent to such a motion by § 15-6-56.” Eide, 1996 SD 11 ¶5, 542 N.W.2d 769 (quoting SDCL 15 — 6—12(b)). “The ‘reasonable opportunity’ language in SDCL 15-6-12(b) prevents unfair surprise.” Id. There is no record of a hearing on the State’s motion to dismiss. The majority would have this court, without notice to the parties or to the trial court, consider the facts at issue in this case and make a determination affirming a summary judgment the trial court did not know it granted on facts the trial court did not state it considered.
[¶ 48] Generally, this court will not decide an issue “until the trial court has had an opportunity to pass on it.” Boever v. South Dakota Bd. of Accountancy, 526 N.W.2d 747, 751; Fullmer v. State Farm Ins. Co., 514 N.W.2d 861, 866 (S.D.1994) (citations omitted); Schull Constr. Co. v. Koenig, 80 S.D. 224„ 227-29, 121 N.W.2d 559, 561 (1963) (citations omitted). The majority states we should affirm the trial court’s summary judgment though it was granted for the wrong reason, and proceeds to discuss the merits of the Wolffs’ claim. The trial court’s order incorrectly stated that the action was dismissed “on the merits and with prejudice.” The trial court did not consider the merits in either its memorandum decision or order dismissing the claims.
[¶ 49] The majority points out that this court has stated summary judgment will be affirmed if there exists any basis which would support the trial court’s ruling. Affirming the result for reasons other than *540those stated by the trial court is one thing. However, affirming the result when: 1) the trial court improperly dismissed on the issue of notice; 2) the trial court improperly converted a motion to dismiss to a summary judgment without notice to the parties; and then, 3) this court proceeds to examine the parties’ contentions without the benefit of a trial court decision or even a statement of facts other than the parties’ briefs and pretrial conference checklists, is another thing altogether. This court does not and should not fill the role of fact finder. See Eichmann v. Eichmann, 485 N.W.2d 206, 209 (S.D.1992).
[¶ 50] Where a judgment is correct, this court will not reverse although it was based on incorrect reasons or erroneous conclusions. However, in cases where this court affirmed the trial court’s result despite its wrong rationale, the trial court generally has considered all pertinent facts. Sommervold v. Grevlos, 518 N.W.2d 733, 740 (S.D.1994) (trial court denied instruction during jury trial); Cowell v. Leapley, 458 N.W.2d 514, 519 (S.D.1990) (trial court used different standard to reach the same result); Brown v. Egan Consol. School Dist., 449 N.W.2d 259, 261 (S.D.1989) (trial court’s denial of summary judgment motion affirmed); Seymour v. Western Dakota Voc. Tech. Institute, 419 N.W.2d 206, 209 (S.D.1988) (trial court memorandum opinion included findings of fact and conclusions of law); Western Air Lines, Inc. v. Hughes County, 372 N.W.2d 106, 109 (S.D.1985) aff'd. 480 U.S. 123, 134, 107 S.Ct. 1038, 1044, 94 L.Ed.2d 112, 123 (1987) (trial court judgment upholding tax for wrong reason affirmed); S.D. Med. Service v. Minn. Mut. Fire & Cas. Co., 303 N.W.2d 358, 362 (S.D.1981) (trial court entered summary judgment after motion and agreement that facts were not in dispute); Owens v. City of Beresford, 87 S.D. 8, 14-16, 201 N.W.2d 890, 893-94 (1972) (during full trial, trial court found ordinance not mandatory which Supreme Court found mandatory); House of Seagram, Inc. v. Assam Drug Co., 83 S.D. 320, 326-28, 159 N.W.2d 210, 214 (1968) (denial of injunction after presentation to trial court on admitted facts); Holmes v. Miller, 71 S.D. 258, 261-62 , 23 N.W.2d 794, 796 (1946) (“Upon the merits the trial court found ... This finding is unchallenged.”); Kirby v. Western Surety Co., 70 S.D. 483, 488, 19 N.W.2d 12, 14 (1945) (“Even conceding that the trial court so determined, the facts upon which such determination is based are undisputed.” (Emphasis added)). Though there exist cases which affirm a trial court for its result without the trial court fully considering the facts (See Kehn v. Hoeksema, 524 N.W.2d 879, 880 (S.D.1994)), those cases are and should be the exception and not the rule.
[¶ 51] The majority reaches the merits and affirms the summary judgment even though the trial court only considered and determined the notice issue. Whether or not the majority’s conclusion turns out to be correct, we should reverse on the notice issue and remand, and should not reach issues neither discussed nor reached by the trial court. In other words, even if the majority is right, we should remand so the trial court can say so, not this court.
[¶ 52] AMUNDSON, J., joins this dissent.. This case differs from the cases cited in Isakson, 526 N.W.2d at 733-34. In those cases, the parties added a contributory negligence claim and a new statutory claim. The opposing party would have to change some of its evidence or trial strategy. Here, because the Secretary was allowed to argue the notice provision, Wolffs' claims sounding in tort were effectively avoided by the State.
. The trial court was apparently unaware that it had converted the motion to dismiss to a motion for summary judgment. It stated in the memorandum decision, "It is this Court's decision that since the jurisdictional notice requirements of the statute were not complied with, this action must be dismissed." The trial court's order stated, "ORDERED that the ... matter be, and it is hereby dismissed!.]”
. SDCL 15 — 6—12(b) provides in part:
If, on a motion ... to dismiss for failure of the pleading ... to state a claim upon which relief can be granted, matters outside the pleading arc presented to and not excluded by the court, the motion shall be treated as one for summary judgment and disposed of as provided in § 15-6-56, and all parties shall be given reasonable opportunity to present all material made pertinent to such a motion by § 15-6-56.
The Secretary’s motion to dismiss did not indicate under which subsection of SDCL 15-6-12(b) it was urging dismissal due to lack of notice.