Switch to compiler-tester
[mono.git] / mcs / tests / gtest-106.cs
1 public struct KeyValuePair<X,Y>
2 {
3         public KeyValuePair (X x, Y y)
4         { }
5 }
6
7 public interface IComparer<T>
8 {
9         int Compare (T x);
10 }
11
12 public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
13 {
14         public int Compare (KeyValuePair<K,V> a)
15         {
16                 return 0;
17         }
18 }
19
20 public class TreeBag<T>
21 {
22         IComparer<T> comparer;
23         T item;
24
25         public TreeBag (IComparer<T> comparer, T item)
26         {
27                 this.comparer = comparer;
28                 this.item = item;
29         }
30
31         public int Find ()
32         {
33                 return comparer.Compare (item);
34         }
35 }
36
37 public class X
38 {
39         public static void Main ()
40         {
41                 KeyValuePair<int,int> pair = new KeyValuePair<int,int> (3, 89);
42                 KeyValuePairComparer<int,int> comparer = new KeyValuePairComparer<int,int> ();
43                 TreeBag<KeyValuePair<int,int>> bag = new TreeBag<KeyValuePair<int,int>> (comparer, pair);
44                 bag.Find ();
45         }
46 }