Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / iface7.cs
1 using System;
2
3 namespace TestMono
4 {
5         public interface IBase {
6                 int Do();
7         }
8
9         public interface IDerived : IBase {
10         }
11
12         public class Base : IBase {
13                 int IBase.Do() {
14                         return 1 + Do();
15                 }
16                 public virtual int Do() {
17                         return 1;
18                 }
19         }
20
21         public class Derived : Base, IDerived {
22         }
23
24         class Class1
25         {
26                 static int Main(string[] args)
27                 {
28                         IDerived id = new Derived();
29                         if (id.Do() != 2)
30                                 return 1;
31                         IBase ib = (IBase) id;
32                         if (ib.Do() != 2)
33                                 return 2;
34                         Derived d = (Derived) id;
35                         if (d.Do() != 1)
36                                 return 3;
37                         Base b = (Base) id;
38                         if (b.Do() != 1)
39                                 return 4;
40                         return 0;
41                 }
42         }
43 }