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

gtest-587.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 60484bdec39e3fe2f17aa1877cae1433d23803bc (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
using System;

struct S
{
	public static implicit operator string (S s)
	{
		return "1";
	}

	public static implicit operator short? (S s)
	{
		return 1;
	}

	public static implicit operator E (S s)
	{
		return 0;
	}
}

public enum E
{
}

class C
{
	public static int Main ()
	{
		E? e = 0;
		const E e1 = (E)44;
		var res = e == e1;
		if (res != false)
			return 1;

		res = e1 == e;
		if (res != false)
			return 2;

		E e2 = 0;
		S s;
		var res2 = e2 & s;
		if (res2 != 0)
			return 3;

		res2 = s & e2;
		if (res2 != 0)
			return 4;

		return 0;
	}
}