Files
mono/mcs/tests/gtest-lambda-25.cs
T
Marek Safar 21f1d2baa4 New tests & update.
svn path=/trunk/mcs/; revision=157672
2010-05-21 09:59:40 +00:00

33 lines
507 B
C#

using System;
namespace MonoBugs
{
public struct Foo<T>
{
public T Item;
}
public static class Bar
{
public static void DoStuff<T> (T item, Action<T> fn)
{
throw new ApplicationException ("failed");
}
public static void DoStuff<T> (T? item, Action<T> fn)
where T : struct
{
fn (item.Value);
}
}
public static class Program
{
public static void Main ()
{
Foo<int>? value = new Foo<int> { Item = 3 };
Bar.DoStuff (value, x => Console.WriteLine (x.Item));
}
}
}