linux-packaging-mono/mcs/tests/test-tuple-01.cs
Xamarin Public Jenkins (auto-signing) 7d05485754 Imported Upstream version 5.8.0.22
Former-commit-id: df344e34b07851d296efb3e6604c8db42b6f7aa3
2017-10-19 20:04:20 +00:00

53 lines
683 B
C#

using System;
static class X
{
static (int, string) Test1 ()
{
return ValueTuple.Create (1, "2");
}
static void Test2 ((int Item1, int Item2) arg)
{
}
static void Test3 ((int a, string b) arg)
{
}
static (int a, string b) Test4 ()
{
return ValueTuple.Create (1, "x");
}
static int Main ()
{
var res = Test1 ();
if (res.Item1 != 1) {
return 1;
}
if (res.Item2 != "2") {
return 2;
}
ValueTuple<int, string> res2 = res;
Test3 (ValueTuple.Create (1, "2"));
var res3 = Test4 ();
if (res3.Item1 != 1)
return 3;
if (res3.a != 1)
return 4;
if (res3.Item2 != "x")
return 5;
if (res3.b != "x")
return 6;
return 0;
}
}