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

test-586.cs « tests « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 896560673c41ef0c12245208383ead4c48079385 (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
class Program
{
	public static int Main ()
	{
		MyColor [] c = new MyColor [1];
		c [0] += new MyColor (1.3F);
		c [0] += new MyColor (1.5F);
		if (c [0].Value != 2.8F)
			return 1;
		return 0;
	}

	public struct MyColor
	{
		private float _value;

		public MyColor (float value)
		{
			_value = value;
		}

		public float Value
		{
			get { return _value; }
		}

		public static MyColor operator + (MyColor a, MyColor b)
		{
			return new MyColor (a._value + b._value);
		}
	}
}