2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-anon-60.cs
bloba38b818d43f2f5d746d41d721e08179083248631
1 using System;
2 using System.Linq.Expressions;
4 namespace TestGenericsSubtypeMatching
6 public class Sender<T> : IDisposable
9 public void DoSend<TMessage> (Action<T> action)
11 using (Sender<T> sub = new Sender<T> ())
13 Send (t =>
15 action(t);
16 sub.ActionOnObject (t);
17 });
21 private static void Send (Action<T> action)
25 void ActionOnObject (object o)
27 o.ToString ();
30 #region IDisposable implementation
31 public void Dispose ()
33 Console.WriteLine ("Dispose!");
36 #endregion
39 class C
41 public static int Main ()
43 new Sender<int> ().DoSend<bool> (l => Console.WriteLine (l));
44 return 0;