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

test-211.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 81eecb75f647f862e5bbcd19e8b990c59811c80e (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
52
53
54
55
56
57
class X
{
	public readonly int value;

	public X (int value)
	{
		this.value = value;
	}

	public static implicit operator X (int y)
	{
		return new X (y);
	}
}

class Y
{
	public readonly X x;

	public Y (X x)
	{
		this.x = x;
	}

	public static implicit operator Y (X x)
	{
		return new Y (x);
	}
}

class Z
{
	public readonly Y y;

	public Z (Y y)
	{
		this.y = y;
	}

	public static implicit operator Z (Y y)
	{
		return new Z (y);
	}

	public static int Main ()
	{
		int a = 5;
		Y y = (Y) (X) a;

		//.
		// Compile this:
		//

		int b = (System.Int32)int.Parse ("1");
		return 0;
	}
}