* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / tests / gtest-114.cs
1 using System;
2 using System.Collections.Generic;
3
4 public class NaturalComparer<T> : IComparer<T>
5         where T: IComparable<T>
6 {
7         public int Compare (T a, T b)
8         {
9                 return a.CompareTo (b);
10         }
11 }
12
13 public class X
14 {
15         class Test : IComparable<Test>
16         {
17                 public int CompareTo (Test that)
18                 {
19                         return 0;
20                 }
21
22                 public bool Equals (Test that)
23                 {
24                         return false;
25                 }
26         }
27
28         static void Main ()
29         {
30                 IComparer<Test> cmp = new NaturalComparer<Test> ();
31                 Test a = new Test ();
32                 Test b = new Test ();
33                 cmp.Compare (a, b);
34         }
35 }