Merge pull request #495 from nicolas-raoul/fix-for-issue2907-with-no-formatting-changes
[mono.git] / mcs / tests / test-31.cs
1 //
2 // Versioning test: make sure that we output a warning, but still call the derived
3 // method
4 //
5 using System;
6
7 class Base {
8         public int which;
9         
10         public virtual void A ()
11         {
12                 which = 1;
13         }
14 }
15
16 class Derived :Base {
17         public virtual void A ()
18         {
19                 which = 2;
20         }
21 }
22
23 class Test {
24         public static int Main ()
25         {
26                 Derived d = new Derived ();
27
28                 //
29                 // This should call Derived.A and output a warning.
30                 //
31                 d.A ();
32
33                 
34                 if (d.which == 1)
35                         return 1;
36
37                 Console.WriteLine ("Test passes");
38                 
39                 return 0;
40         }
41 }