Merge pull request #4935 from lambdageek/dev-handles-may
[mono.git] / mcs / tests / test-partial-03.cs
1 // Compiler options: -langversion:default
2
3 public partial class Test
4 {
5         public readonly Foo TheFoo;
6
7         public Test ()
8         {
9                 this.TheFoo = new Foo ();
10         }
11
12         public partial interface IFoo
13         {
14                 int Hello (Test foo);
15         }
16
17         public int TestFoo ()
18         {
19                 return TheFoo.Hello (this);
20         }
21 }
22
23 public partial class Test
24 {
25         public partial class Foo : IFoo
26         {
27                 int IFoo.Hello (Test test)
28                 {
29                         return 2;
30                 }
31
32                 public int Hello (Test test)
33                 {
34                         return 1;
35                 }
36         }
37
38         public int TestIFoo (IFoo foo)
39         {
40                 return foo.Hello (this);
41         }
42 }
43
44 class X
45 {
46         public static int Main ()
47         {
48                 Test test = new Test ();
49                 if (test.TestFoo () != 1)
50                         return 1;
51                 if (test.TestIFoo (test.TheFoo) != 2)
52                         return 2;
53                 return 0;
54         }
55 }