[Wasm] Fix memory override in mono_wasm_add_assembly
[mono-project.git] / mcs / tests / gtest-106.cs
blob22fc8e46e56c12c33938b6da71ce61db13fab2aa
1 public struct KeyValuePair<X,Y>
3 public KeyValuePair (X x, Y y)
4 { }
7 public interface IComparer<T>
9 int Compare (T x);
12 public class KeyValuePairComparer<K,V> : IComparer<KeyValuePair<K,V>>
14 public int Compare (KeyValuePair<K,V> a)
16 return 0;
20 public class TreeBag<T>
22 IComparer<T> comparer;
23 T item;
25 public TreeBag (IComparer<T> comparer, T item)
27 this.comparer = comparer;
28 this.item = item;
31 public int Find ()
33 return comparer.Compare (item);
37 public class X
39 public static void Main ()
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 ();