Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / tests / bug-77127.cs
1 using System;
2
3 public interface IX {}
4 public interface IY : IX {}
5
6 public class X : IX {
7         public override string ToString () {
8                 return "X";
9         }
10 }
11
12 public class Y : IY {
13         public override string ToString () {
14                 return "Y";
15         }
16 }
17
18 public interface IA {
19         IX Prop { get; }
20 }
21
22 public interface IB : IA {
23         new IY Prop { get; }
24 }
25
26 public interface IC : IB {
27 }
28
29 public class A : IA {
30
31         IX IA.Prop {
32                 get { return new X (); }
33         }
34 }
35
36 public class B : A, IA, IB {
37         IX IA.Prop {
38                 get { return new Y (); }
39         }
40
41         IY IB.Prop {
42                 get { return new Y (); }
43         }
44 }
45
46 public class C : B, IC {
47 }
48
49 class MainClass {
50         static int Main(string[] args) {
51                 IC c = new C ();
52                 IX w = ((IA)c).Prop;
53                 if (w.ToString () == "Y") {
54                         return 0;
55                 } else {
56                         return 1;
57                 }
58                 Console.WriteLine (w.ToString ());
59         }
60 }