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>2010-10-01 17:20:39 +0400
committerMarek Safar <marek.safar@gmail.com>2010-10-01 17:23:59 +0400
commitb226844cd7e1b9f5e575c413858b344076217b2e (patch)
tree7ab13aaa2ced1acf7222180fad13f8b369b43d03 /mcs/tests/dtest-033.cs
parentc4fd3c18842012013395e4c6ed231dfdcb051d08 (diff)
Dynamic compound assignment breaks standard C# result conversion rules
Diffstat (limited to 'mcs/tests/dtest-033.cs')
-rw-r--r--mcs/tests/dtest-033.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/mcs/tests/dtest-033.cs b/mcs/tests/dtest-033.cs
new file mode 100644
index 00000000000..8a0f13b93d3
--- /dev/null
+++ b/mcs/tests/dtest-033.cs
@@ -0,0 +1,34 @@
+using System;
+
+public class Test
+{
+ byte Prop {
+ get { return 4; }
+ set { }
+ }
+
+ byte this [int arg] {
+ get { return 2; }
+ set { }
+ }
+
+ public static int Main ()
+ {
+ dynamic v = 'a';
+ dynamic a = new Test ();
+
+ string s = "-sdfas";
+
+ // dynamic compound assignment with different result type
+ v += s;
+
+ if (v != "a-sdfas")
+ return 1;
+
+ byte b = 4;
+ a.Prop *= b;
+ a[4] ^= b;
+
+ return 0;
+ }
+} \ No newline at end of file