2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / tests / gtest-anon-39.cs
blob556ea1cc2860f25be4d27232ed38c9ff47670928
1 using System;
3 public class Test
5 delegate void D ();
7 public static void Main ()
9 Test t = new Test ();
10 t.Test_1 (t);
11 t.Test_2<int> (1);
12 t.Test_3<Test> (1);
15 public void Test_1<T> (T t) where T : Test
17 D d = delegate () {
18 Action<T> d2 = new Action<T> (t.Test_1);
20 d ();
23 public void Test_2<T> (T? t) where T : struct
25 bool b;
26 T t2;
27 D d = delegate () {
28 b = t == null;
29 t2 = (T)t;
30 t2 = t ?? default (T);
33 d ();
36 public T Test_3<T> (object o) where T : class
38 bool b;
39 T t2 = null;
40 D d = delegate () {
41 t2 = o as T;
44 d ();
45 return t2;