Merge pull request #4816 from BrzVlad/fix-remoting-exception
[mono.git] / mcs / tests / test-anon-160.cs
1 using System;
2 using System.Linq.Expressions;
3
4 namespace TestGenericsSubtypeMatching
5 {
6         public class Sender<T> : IDisposable
7         {
8
9                 public void DoSend<TMessage> (Action<T> action)
10                 {
11                         using (Sender<T> sub = new Sender<T> ())
12                         {
13                                 Send (t =>
14                                 {
15                                         action(t);
16                                         sub.ActionOnObject (t);
17                                 });
18                         }
19                 }
20                 
21                 private static void Send (Action<T> action)
22                 {
23                 }
24                 
25                 void ActionOnObject (object o)
26                 {
27                         o.ToString ();
28                 }
29         
30                 #region IDisposable implementation
31                 public void Dispose ()
32                 {
33                         Console.WriteLine ("Dispose!");
34                 }
35                 
36                 #endregion
37         }
38         
39         class C
40         {
41                 public static int Main ()
42                 {
43                         new Sender<int> ().DoSend<bool> (l => Console.WriteLine (l));
44                         return 0;
45                 }
46         }
47 }