a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
28 lines
385 B
C#
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 ();
|
|
}
|
|
}
|
|
|