dlr bug
[mcs.git] / tests / test-29.cs
blob6183126d277214af91462a9d74d95deb15acdc92
1 //
2 // Versioning, should choose Derived.Add (1)
3 //
4 using System;
6 class Base {
7 public int val;
9 public void Add (int x)
11 Console.WriteLine ("Incorrect method called");
13 val = 1;
17 class Derived : Base {
18 public void Add (double x)
20 Console.WriteLine ("Calling the derived class with double! Excellent!");
21 val = 2;
25 class Demo {
27 static int Main ()
29 Derived d = new Derived ();
31 d.Add (1);
32 if (d.val == 1)
33 return 1;
35 if (d.val == 2)
36 return 0;
37 return 2;