Merge pull request #5675 from mono/glib-debug-symbols
[mono.git] / mcs / tests / gtest-exmethod-03.cs
1
2
3 using System;
4
5 namespace A
6 {
7         public static class A
8         {
9                 public static int Foo (this int i)
10                 {
11                         return 1;
12                 }
13                 
14                 public static int Foo (this int i, string s)
15                 {
16                         return 30;
17                 }
18         }
19 }
20
21 namespace B
22 {
23         public static class X
24         {
25                 public static int Foo (this int i)
26                 {
27                         return 2;
28                 }
29                 
30                 public static int Foo (this int i, bool b)
31                 {
32                         return 20;
33                 }
34         }
35 }
36
37 namespace C
38 {
39         using A;
40         using B;
41         using D;
42         
43         public static class F
44         {
45                 public static bool Foo (this byte i)
46                 {
47                         return false;
48                 }
49         }
50         
51         namespace D
52         {
53                 public static class F
54                 {
55                         public static int Foo (this int i)
56                         {
57                                 return 66;
58                         }
59                         
60                         public static void TestX ()
61                         {
62                                 int i = 2.Foo (false);
63                         }
64                 }
65         }
66         
67         public static class M
68         {
69                 public static int Foo (this int i)
70                 {
71                         return 4;
72                 }
73
74                 public static int Main ()
75                 {
76                         if (3.Foo ("a") != 30)
77                                 return 1;
78                         
79                         if (((byte)0).Foo ())
80                                 return 2;
81                         
82                         if (4.Foo (false) != 20)
83                                 return 3;
84                         
85                         Console.WriteLine ("OK");
86                         return 0;
87                 }
88         }
89 }