* roottypes.cs: Rename from tree.cs.
[mono.git] / mcs / tests / gtest-061.cs
1 using System;
2
3 public delegate B Test<A,B> (A a);
4
5 public class Foo<T>
6 {
7         T t;
8
9         public Foo (T t)
10         {
11                 this.t = t;
12         }
13
14         public U Method<U> (Test<T,U> test)
15         {
16                 return test (t);
17         }
18 }
19
20 class X
21 {
22         static void Main ()
23         {
24                 Test<double,int> test = new Test<double,int> (Math.Sign);
25
26                 Foo<double> foo = new Foo<double> (Math.PI);
27                 Console.WriteLine (foo.Method<int> (test));
28
29                 string s = foo.Method<string> (delegate (double d) { return "s" + d; });
30                 Console.WriteLine (s);
31         }
32 }