update readme (#21797)
[mono-project.git] / mcs / tests / test-tuple-01.cs
blobbbea77729371ccae32477bee2f10b45ab7dff9f4
1 using System;
3 static class X
5 static (int, string) Test1 ()
7 return ValueTuple.Create (1, "2");
10 static void Test2 ((int Item1, int Item2) arg)
14 static void Test3 ((int a, string b) arg)
18 static (int a, string b) Test4 ()
20 return ValueTuple.Create (1, "x");
23 static int Main ()
25 var res = Test1 ();
26 if (res.Item1 != 1) {
27 return 1;
30 if (res.Item2 != "2") {
31 return 2;
34 ValueTuple<int, string> res2 = res;
36 Test3 (ValueTuple.Create (1, "2"));
38 var res3 = Test4 ();
39 if (res3.Item1 != 1)
40 return 3;
42 if (res3.a != 1)
43 return 4;
45 if (res3.Item2 != "x")
46 return 5;
48 if (res3.b != "x")
49 return 6;
51 return 0;