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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Safar <marek.safar@gmail.com>2008-10-03 14:21:44 +0400
committerMarek Safar <marek.safar@gmail.com>2008-10-03 14:21:44 +0400
commitf3320a409ec9164f5d5f4d8d598d6a9c853cb4ef (patch)
treee5edea11d8ac9d75031f3ee51147a354fef9073a /mcs/tests/test-687.cs
parent05f86becee556b7bbda538360d05fee9f4e8e761 (diff)
New tests.
svn path=/trunk/mcs/; revision=114740
Diffstat (limited to 'mcs/tests/test-687.cs')
-rwxr-xr-xmcs/tests/test-687.cs57
1 files changed, 57 insertions, 0 deletions
diff --git a/mcs/tests/test-687.cs b/mcs/tests/test-687.cs
new file mode 100755
index 00000000000..b65722957ba
--- /dev/null
+++ b/mcs/tests/test-687.cs
@@ -0,0 +1,57 @@
+using System;
+
+struct XUnit
+{
+ public XUnit(double point)
+ {
+ this.Point = point;
+ }
+
+ double Point;
+
+ public static implicit operator XUnit(double value)
+ {
+ XUnit unit;
+ unit.Point = value;
+ return unit;
+ }
+
+ public static implicit operator double(XUnit value)
+ {
+ return value.Point;
+ }
+}
+
+struct Unit
+{
+ public Unit(double point)
+ {
+ this.Point = point;
+ }
+
+ double Point;
+
+ public static implicit operator Unit(double value)
+ {
+ Unit unit;
+ unit.Point = value;
+ return unit;
+ }
+
+ public static implicit operator double(Unit value)
+ {
+ return value.Point;
+ }
+}
+
+class Test
+{
+ public static int Main()
+ {
+ XUnit xunit = new XUnit();
+ Unit unit = new Unit();
+ Unit uu = unit + xunit;
+ unit += xunit;
+ return 0;
+ }
+}