Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

33 lines
480 B
C#

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);
}
}
}