2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / gtest-lambda-25.cs
blob2636b4a8f28c344e305846d27a3d24db03239d11
1 using System;
3 namespace MonoBugs
5 public struct Foo<T>
7 public T Item;
10 public static class Bar
12 public static void DoStuff<T> (T item, Action<T> fn)
14 throw new ApplicationException ("failed");
17 public static void DoStuff<T> (T? item, Action<T> fn)
18 where T : struct
20 fn (item.Value);
24 public static class Program
26 public static void Main ()
28 Foo<int>? value = new Foo<int> { Item = 3 };
29 Bar.DoStuff (value, x => Console.WriteLine (x.Item));