New test.
[mono.git] / mcs / tests / gtest-239.cs
1 using System;
2
3 class Foo<T,U>
4 {
5         public int Test (T t, U u)
6         {
7                 return 1;
8         }
9
10         public int Test (int t, U u)
11         {
12                 return 2;
13         }
14
15         public int Test (T t, float u)
16         {
17                 return 3;
18         }
19
20         public int Test (int t, float u)
21         {
22                 return 4;
23         }
24 }
25
26 class X
27 {
28         static int Main ()
29         {
30                 Foo<long,float> a = new Foo<long,float> ();
31                 if (a.Test (3L, 3.14F) != 3)
32                         return 1;
33                 if (a.Test (3L, 8) != 3)
34                         return 2;
35                 if (a.Test (3, 3.14F) != 4)
36                         return 3;
37                 if (a.Test (3, 8) != 4)
38                         return 4;
39
40                 Foo<long,double> b = new Foo<long,double> ();
41                 if (b.Test (3L, 3.14F) != 3)
42                         return 5;
43                 if (b.Test (3, 3.14F) != 4)
44                         return 6;
45                 if (b.Test (3L, 3.14F) != 3)
46                         return 7;
47                 if (b.Test (3L, 5) != 3)
48                         return 8;
49
50                 Foo<string,float> c = new Foo<string,float> ();
51                 if (c.Test ("Hello", 3.14F) != 3)
52                         return 9;
53
54                 Foo<int,string> d = new Foo<int,string> ();
55                 if (d.Test (3, "Hello") != 2)
56                         return 10;
57
58                 return 0;
59         }
60 }