2009-02-15 Jonathan Chambers <joncham@gmail.com>
[mcs.git] / tests / gtest-061.cs
bloba7486896238227e46060138d75965ec608f18df7
1 using System;
3 public delegate B Test<A,B> (A a);
5 public class Foo<T>
7 T t;
9 public Foo (T t)
11 this.t = t;
14 public U Method<U> (Test<T,U> test)
16 return test (t);
20 class X
22 static void Main ()
24 Test<double,int> test = new Test<double,int> (Math.Sign);
26 Foo<double> foo = new Foo<double> (Math.PI);
27 Console.WriteLine (foo.Method<int> (test));
29 string s = foo.Method<string> (delegate (double d) { return "s" + d; });
30 Console.WriteLine (s);