[mcs] C#7 tuples var deconstruct
[mono.git] / mcs / tests / test-tuple-03.cs
index 7eb45a893ca0919d7d0df06343ad2c1e15c64dd8..dfc07de4a7ecc932e6aac7bae2377a3ba35e7158 100644 (file)
@@ -3,24 +3,32 @@ using System.Linq.Expressions;
 
 class TupleDeconstruct
 {
+       static int s_xx;
+       static long s_yy;
+
        public static int Main ()
        {
-//             var (xx, yy) = (1, 2);
-//             if (xx != 1)
-//                     return 1;
+               var (xx, yy) = (1, 2);
+               if (xx != 1)
+                       return 1;
 
-//             if (yy != 2)
-//                     return 2;
+               if (yy != 2)
+                       return 2;
 
                int x, y;
                (x, y) = (1, 2);
                if (x != 1)
-                       return 1;
+                       return 3;
 
                if (y != 2)
-                       return 2;
+                       return 4;
+
+               (s_xx, s_yy) = Test3 ();
+               if (s_xx != 1)
+                       return 5;
 
-//             var (l1, l2) = ('a', 'b');
+               if (s_yy != 3)
+                       return 6;
 
 //             var cwd = new ClassWithDeconstruct ();
 //             var (m1, m2) = cwd;
@@ -36,8 +44,9 @@ class TupleDeconstruct
                (c.Prop1, c.Prop2) = (1, 2);
        }
 
-       static void var1 (object o1, object o2)
+       static (int, long) Test3 ()
        {
+               return (1, 3);
        }
 
        static void TestCustom ()