summaryrefslogtreecommitdiff
path: root/mcs/tests/gtest-initialize-14.cs
blob: 1365493546693ad7d60763bc773ff70e259af6f0 (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
using System;

struct S
{
	public int X, Y;
}

class X
{
	public static int Main ()
	{
		var rect = new S {
			X = 1,
			Y = 2,
		};

		if (rect.X != 1)
			return 1;

		if (rect.Y != 2)
			return 2;

		rect = new S {
			X = rect.X,
			Y = rect.Y,
		};

		if (rect.X != 1)
			return 3;

		if (rect.Y != 2)
			return 4;

		return 0;
	}
}