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>2017-10-03 03:27:20 +0300
committerMarek Safar <marek.safar@gmail.com>2017-10-03 12:23:18 +0300
commitadaf7fd65b9a53a8e127d41bf430e56001c6e472 (patch)
tree283b83d163fdafd6febc57008cc56f615fd1baad /mcs/tests/test-ref-06.cs
parent9369ed6e23ee9e822a3aa2318ed55f083241fbcb (diff)
[mcs] Allow properties and indexers of by-ref values to be set without setter
Diffstat (limited to 'mcs/tests/test-ref-06.cs')
-rw-r--r--mcs/tests/test-ref-06.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/mcs/tests/test-ref-06.cs b/mcs/tests/test-ref-06.cs
new file mode 100644
index 00000000000..74d35f44ed8
--- /dev/null
+++ b/mcs/tests/test-ref-06.cs
@@ -0,0 +1,24 @@
+using System;
+
+class X
+{
+ public static int Main ()
+ {
+ var x = new X ();
+ x [0] = 3;
+ if (x.field != 3)
+ return 1;
+ x.Prop = 5;
+ if (x.field != 5)
+ return 2;
+
+ return 0;
+ }
+
+ int field;
+
+ ref int this [int idx] => ref field;
+
+ ref int Prop => ref field;
+
+} \ No newline at end of file