summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-621.cs
blob: cfff301328ed9d824a550f1c2f9811cc16c7d850 (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
28
29
using System;

class X
{
	static int Main ()
	{
		int? intArg = 1;
		long? longArg = 2;

		var g = intArg ?? longArg;
		Console.WriteLine (g);
		if (g != 1)
			return 1;

		intArg = null;
		g = intArg ?? longArg;
		Console.WriteLine (g);
		if (g != 2)
			return 2;

		longArg = null;
		g = intArg ?? longArg;
		Console.WriteLine (g);
		if (g != null)
			return 3;
			
		return 0;
	}
}