Browse files

* bug-77127.cs: Test for bug #77127.

	* Makefile.am: Added bug-77127.cs.


svn path=/trunk/mono/; revision=83647
  • Loading branch information...
1 parent 6faac16 commit 266348803fbedcb6e5242ce62a0423ae29ea1d80 Massimiliano Mantione committed Aug 8, 2007
Showing with 66 additions and 0 deletions.
  1. +5 −0 mono/tests/ChangeLog
  2. +1 −0 mono/tests/Makefile.am
  3. +60 −0 mono/tests/bug-77127.cs
View
5 mono/tests/ChangeLog
@@ -1,3 +1,8 @@
+2007-08-08 Massimiliano Mantione <massi@ximian.com>
+
+ * bug-77127.cs: Test for bug #77127.
+ * Makefile.am: Added bug-77127.cs.
+
2007-08-01 William Holmes <billholmes54@gmail.com>
* Makefile.am: Added bug-82194.2.cs.
View
1 mono/tests/Makefile.am
@@ -208,6 +208,7 @@ TEST_CS_SRC= \
bug-78311.cs \
bug-78653.cs \
bug-78656.cs \
+ bug-77127.cs \
interlocked.cs \
cross-domain.cs \
appdomain-exit.cs \
View
60 mono/tests/bug-77127.cs
@@ -0,0 +1,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 ());
+ }
+}

0 comments on commit 2663488

Please sign in to comment.