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

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

enum E : byte
{
	V
}

class A
{
	int value;
	
	private A (int value)
	{
		this.value = value;
	}
	
	public static implicit operator byte (A a)
	{
		return 6;
	}

	public static implicit operator A (int a)
	{
		return new A (a);
	}
	
	public static int Main ()
	{
		var a = new A (0);
		a++;
		if (a.value != 7)
			return 1;
		
		var e = E.V;
		e++;
		
		if ((int) e != 1)
			return 2;
		
		return 0;
	}
}