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-09-19 16:47:31 +0300
committerMarek Safar <marek.safar@gmail.com>2017-10-02 17:23:04 +0300
commit34866ac4c20c781f10c40fe6f6fe0c39733fd946 (patch)
tree6ab6012a02e9c73da8c9dca6592854b5afaf26a3 /mcs/tests/test-ref-05.cs
parent120574de1935e11c7b39a0be75bb2803453ceadb (diff)
[mcs] Initial by ref returns and variables support
Diffstat (limited to 'mcs/tests/test-ref-05.cs')
-rw-r--r--mcs/tests/test-ref-05.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/mcs/tests/test-ref-05.cs b/mcs/tests/test-ref-05.cs
new file mode 100644
index 00000000000..4848468cfda
--- /dev/null
+++ b/mcs/tests/test-ref-05.cs
@@ -0,0 +1,46 @@
+class X
+{
+ static int field;
+
+ public static int Main ()
+ {
+ Test () = 3;
+
+ if (field != (byte) 3)
+ return 1;
+
+ G<string>.Test (ref field) = 6;
+ if (field != 6)
+ return 2;
+
+ --Test ();
+ if (field != 5)
+ return 3;
+
+ Test (ref Test (), ref Test ());
+
+ return 0;
+ }
+
+ static ref int Test ()
+ {
+ return ref field;
+ }
+
+ static void Test<T> (ref T a, ref int b)
+ {
+ }
+
+ static void Test2<T> (ref T arg)
+ {
+ Test (ref arg, ref Test ());
+ }
+}
+
+class G<U>
+{
+ public static ref T Test<T> (ref T arg)
+ {
+ return ref arg;
+ }
+} \ No newline at end of file