Welcome to mirror list, hosted at ThFree Co, Russian Federation.

bug-77127.cs « tests « mono - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: f506927d3abe842c5b3914f332645b7295030d4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;

public interface IX {}
public interface IY : IX {}

public class X : IX {
        public override string ToString () {
                return "X";
        }
}

public class Y : IY {
        public override string ToString () {
                return "Y";
        }
}

public interface IA {
        IX Prop { get; }
}

public interface IB : IA {
        new IY Prop { get; }
}

public interface IC : IB {
}

public class A : IA {

        IX IA.Prop {
                get { return new X (); }
        }
}

public class B : A, IA, IB {
        IX IA.Prop {
                get { return new Y (); }
        }

        IY IB.Prop {
                get { return new Y (); }
        }
}

public class C : B, IC {
}

class MainClass {
        static int Main(string[] args) {
                IC c = new C ();
                IX w = ((IA)c).Prop;
		if (w.ToString () == "Y") {
			return 0;
		} else {
			return 1;
		}
                Console.WriteLine (w.ToString ());
        }
}