2010-06-04 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-724.cs
blobd4ca16add968b18f07622421a6eb80c05761b57b
1 public class Test
3 private static int DoTest (string type, string expected, string actual, int failcode)
5 if (!actual.Equals (expected)) {
6 System.Console.WriteLine ("Bad {0}: Expected {1}, Was {2}",
7 type, expected, actual);
8 return failcode;
10 return 0;
13 public static int Main ()
15 int failure = 0;
16 Concrete val = new Concrete ();
18 failure |= DoTest ("A", "A", ((A) val).Spec, 0x01);
19 failure |= DoTest ("B", "B", ((B) val).Spec, 0x02);
20 failure |= DoTest ("C", "B", ((C) val).Spec, 0x04);
21 failure |= DoTest ("Concrete", "Concrete", val.Spec, 0x08);
23 return failure;
27 interface A
29 string Spec { get; }
32 interface B : A
34 new string Spec { get; }
37 interface C : B
41 class Concrete : C
43 string A.Spec { get { return "A"; } }
44 string B.Spec { get { return "B"; } }
45 public string Spec { get { return "Concrete"; } }