Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-29.cs
1 //
2 // Versioning, should choose Derived.Add (1)
3 //
4 using System;
5
6 class Base {
7         public int val;
8         
9         public void Add (int x)
10         {
11                 Console.WriteLine ("Incorrect method called");
12  
13                 val = 1;
14         }
15 }
16
17 class Derived : Base {
18         public void Add (double x)
19         {
20                 Console.WriteLine ("Calling the derived class with double! Excellent!");
21                 val = 2;
22         }
23 }
24
25 class Demo {
26
27         public static int Main ()
28         {
29                 Derived d = new Derived ();
30
31                 d.Add (1);
32                 if (d.val == 1)
33                         return 1;
34
35                 if (d.val == 2)
36                         return 0;
37                 return 2;
38
39         }
40 }