Merge pull request #496 from nicolas-raoul/unit-test-for-issue2907
[mono.git] / mcs / tests / test-80.cs
1 //
2 // This test is used to check that we can actually use implementations
3 // provided in our parent to interfaces declared afterwards.
4 //
5
6 using System;
7
8 public interface A {
9         int Add (int a, int b);
10 }
11
12 public class X {
13         public int Add (int a, int b)
14         {
15                 return a + b;
16         }
17 }
18
19 class Y : X, A {
20
21         public static int Main ()
22         {
23                 Y y = new Y ();
24                 
25                 if (y.Add (1, 1) != 2)
26                         return 1;
27
28                 Console.WriteLine ("parent interface implementation test passes");
29                 return 0;
30         }
31         
32 }