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>2012-01-17 16:32:50 +0400
committerMarek Safar <marek.safar@gmail.com>2012-01-17 16:34:13 +0400
commitdff3590549330fde4b8c172397b491ca045ad608 (patch)
tree63b8a4e4bda7ccdcea40925c300c33d24a379440 /mcs/tests/test-841.cs
parentacdb58d09ff4b41517a9294482eddc1d83a41857 (diff)
Use correct offset when setting comples struct field assignment. Fixes #2861
Diffstat (limited to 'mcs/tests/test-841.cs')
-rw-r--r--mcs/tests/test-841.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/mcs/tests/test-841.cs b/mcs/tests/test-841.cs
new file mode 100644
index 00000000000..2cfdc0f00cb
--- /dev/null
+++ b/mcs/tests/test-841.cs
@@ -0,0 +1,37 @@
+struct S
+{
+ public R a, b;
+}
+
+struct R
+{
+ public double v;
+
+ public static implicit operator R (int v)
+ {
+ return new R ();
+ }
+
+ public static implicit operator double (R r)
+ {
+ return r.v;
+ }
+}
+
+class C
+{
+ public static int Main ()
+ {
+ S r1, r2;
+ r1.a = 1;
+ r1.b = 2;
+
+ r2.a = 1;
+ r2.b = 2;
+
+ bool b = r1.a == r2.a && r1.b == r2.b;
+ if (!b)
+ return 1;
+ return 0;
+ }
+} \ No newline at end of file