[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / tests / test-tuple-03.cs
blobdfc07de4a7ecc932e6aac7bae2377a3ba35e7158
1 using System;
2 using System.Linq.Expressions;
4 class TupleDeconstruct
6 static int s_xx;
7 static long s_yy;
9 public static int Main ()
11 var (xx, yy) = (1, 2);
12 if (xx != 1)
13 return 1;
15 if (yy != 2)
16 return 2;
18 int x, y;
19 (x, y) = (1, 2);
20 if (x != 1)
21 return 3;
23 if (y != 2)
24 return 4;
26 (s_xx, s_yy) = Test3 ();
27 if (s_xx != 1)
28 return 5;
30 if (s_yy != 3)
31 return 6;
33 // var cwd = new ClassWithDeconstruct ();
34 // var (m1, m2) = cwd;
36 // (string, string) ss = cwd; // Error
38 return 0;
41 static void Test2 ()
43 var c = new C ();
44 (c.Prop1, c.Prop2) = (1, 2);
47 static (int, long) Test3 ()
49 return (1, 3);
52 static void TestCustom ()
54 return;
58 class ClassWithDeconstruct
60 public void Deconstruct (out string f, out string s)
62 f = "a";
63 s = "z";
67 class C
69 public int Prop1 { get; set; }
70 public int Prop2 { get; set; }