linux-packaging-mono/mcs/tests/gtest-etree-03.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

28 lines
385 B
C#

using System;
using System.Linq.Expressions;
struct S<T> where T : struct
{
public static int Test ()
{
Expression<Func<T?, bool>> e = (T? o) => o == null;
if (!e.Compile ().Invoke (null))
return 1;
if (e.Compile ().Invoke (default (T)))
return 2;
Console.WriteLine ("OK");
return 0;
}
}
class C
{
public static int Main()
{
return S<int>.Test ();
}
}