Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / test-826.cs
1 using System;
2 using System.Reflection;
3
4 public interface I
5 {
6         int Foo ();
7 }
8
9 public class A : I
10 {
11         int I.Foo ()
12         {
13                 Console.WriteLine ("a");
14                 return 1;
15         }
16 }
17
18 public class AA : A, I
19 {
20         public int Foo ()
21         {
22                 Console.WriteLine ("aa");
23                 return 2;
24         }
25 }
26
27 public class B : A
28 {
29         public int Foo ()
30         {
31                 Console.WriteLine ("b");
32                 return 3;
33         }
34 }
35
36 public class Test
37 {
38         public static int Main ()
39         {
40                 I i = new AA ();
41                 if (i.Foo () != 2)
42                         return 1;
43                 
44                 i = new B ();
45                 if (i.Foo () != 1)
46                         return 2;
47                 
48                 var m = typeof (B).GetMethod ("Foo");
49                 Console.WriteLine (m.Attributes);
50                 if (m.Attributes != (MethodAttributes.Public | MethodAttributes.HideBySig))
51                         return 3;
52                 
53                 return 0;
54         }
55 }