2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-687.cs
blobb65722957ba326eb5addfdbda3a342a8ce85b2ee
1 using System;
3 struct XUnit
5 public XUnit(double point)
7 this.Point = point;
10 double Point;
12 public static implicit operator XUnit(double value)
14 XUnit unit;
15 unit.Point = value;
16 return unit;
19 public static implicit operator double(XUnit value)
21 return value.Point;
25 struct Unit
27 public Unit(double point)
29 this.Point = point;
32 double Point;
34 public static implicit operator Unit(double value)
36 Unit unit;
37 unit.Point = value;
38 return unit;
41 public static implicit operator double(Unit value)
43 return value.Point;
47 class Test
49 public static int Main()
51 XUnit xunit = new XUnit();
52 Unit unit = new Unit();
53 Unit uu = unit + xunit;
54 unit += xunit;
55 return 0;