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

test-841.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2cfdc0f00cb341c26995ff2f29877ddc68461ad4 (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
struct S
{
	public R a, b;
}

struct R
{
	public double v;
	
	public static implicit operator R (int v)
	{
		return new R ();
	}
	
	public static implicit operator double (R r)
	{
		return r.v;
	}
}

class C
{
	public static int Main ()
	{
		S r1, r2;
		r1.a = 1;
		r1.b = 2;
		
		r2.a = 1;
		r2.b = 2;
		
		bool b = r1.a == r2.a && r1.b == r2.b;
		if (!b)
			return 1;
		return 0;
	}
}