Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-tuple-01.cs
1 using System;
2
3 static class X
4 {
5         static (int, string) Test1 ()
6         {
7                 return ValueTuple.Create (1, "2");
8         }
9
10         static void Test2 ((int Item1, int Item2) arg)
11         {
12         }
13
14         static void Test3 ((int a, string b) arg)
15         {
16         }
17
18         static (int a, string b) Test4 ()
19         {
20                 return ValueTuple.Create (1, "x");
21         }
22
23         static int Main ()
24         {
25                 var res = Test1 ();
26                 if (res.Item1 != 1) {
27                         return 1;
28                 }
29
30                 if (res.Item2 != "2") {
31                         return 2;
32                 }
33
34                 ValueTuple<int, string> res2 = res;
35
36                 Test3 (ValueTuple.Create (1, "2"));
37
38                 var res3 = Test4 ();
39                 if (res3.Item1 != 1)
40                         return 3;
41
42                 if (res3.a != 1)
43                         return 4;
44
45                 if (res3.Item2 != "x")
46                         return 5;
47
48                 if (res3.b != "x")
49                         return 6;
50
51                 return 0;
52         }
53 }