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

test-123.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bd793f9f1a6bec4464774000c91c054c9650b6ad (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
class X {

	static object get_non_null ()
	{
		return new X ();
	}

	static object get_null ()
	{
		return null;
	}
	
	public static int Main ()
	{
		int a = 5;
		object o;
		decimal d = 0M;
		
		//
		// compile time
		//
		if (!(get_non_null () is object))
			return 1;

		if (get_null () is object)
			return 2;

		if (!(a is object))
			return 3;

		//
		// explicit reference
		//
		if (null is object)
			return 4;

		o = a;
		if (!(o is int))
			return 5;

		if (d is int)
			return 6;
			
		object oi = 1;
		if (!(oi is int))
			return 7;

		System.Console.WriteLine ("Is tests pass");
		return 0;
	}
}