Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gtest-294.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d66c6e2f3b5c79df2d4fa318cd0b13604cadce28 (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
30
31
class A {}
class B : A {}

class X
{
	public static A Test (A a, B b)
	{
		return b ?? a;
	}

	static int Main ()
	{
		A a = new A ();
		B b = new B ();

		if (Test (a, b) != b)
			return 1;

		if (Test (null, b) != b)
			return 2;

		if (Test (a, null) != a)
			return 3;

		if (Test (null, null) != null)
			return 4;

		return 0;

	}
}