summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-etree-03.cs
blob: de9266c23faa679792dff4f4beedf650f818b5db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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 ();
	}
}