diff options
author | Marek Safar <marek.safar@gmail.com> | 2017-07-01 01:34:37 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-07-01 01:34:37 +0300 |
commit | 18dc4ebcd0297e0dc51067c3aaa91fe2c1540052 (patch) | |
tree | 87bb2203e9462eff945898e2adc8e65ccd59c6b7 /mcs/errors | |
parent | 2ceb6e94027c28dd84a8db68680134a14ec26635 (diff) |
[mcs] C#7 tuples var deconstruct
Diffstat (limited to 'mcs/errors')
-rw-r--r-- | mcs/errors/cs0128-5.cs | 11 | ||||
-rw-r--r-- | mcs/errors/cs8130.cs | 10 | ||||
-rw-r--r-- | mcs/errors/cs8132-2.cs | 18 | ||||
-rw-r--r-- | mcs/errors/cs8132.cs | 2 | ||||
-rw-r--r-- | mcs/errors/cs8199.cs | 10 | ||||
-rw-r--r-- | mcs/errors/known-issues-net_4_x | 1 |
6 files changed, 50 insertions, 2 deletions
diff --git a/mcs/errors/cs0128-5.cs b/mcs/errors/cs0128-5.cs new file mode 100644 index 00000000000..405537d4331 --- /dev/null +++ b/mcs/errors/cs0128-5.cs @@ -0,0 +1,11 @@ +// CS0128: A local variable named `xx' is already defined in this scope +// Line: 9 + +class X +{ + public static void Main () + { + short xx; + var (xx, yy) = (1, 'g'); + } +}
\ No newline at end of file diff --git a/mcs/errors/cs8130.cs b/mcs/errors/cs8130.cs new file mode 100644 index 00000000000..de6d131c023 --- /dev/null +++ b/mcs/errors/cs8130.cs @@ -0,0 +1,10 @@ +// CS8130: Cannot infer the type of implicitly-typed deconstruction variable `yy' +// Line: 8 + +class X +{ + public static void Main () + { + var (xx, yy) = (1, Main); + } +}
\ No newline at end of file diff --git a/mcs/errors/cs8132-2.cs b/mcs/errors/cs8132-2.cs new file mode 100644 index 00000000000..5658fa99d6b --- /dev/null +++ b/mcs/errors/cs8132-2.cs @@ -0,0 +1,18 @@ +// CS8132: Cannot deconstruct a tuple of `2' elements into `3' variables +// Line: 11 + +class X +{ + static int xx; + static long yy, zz; + + public static void Main () + { + (xx, yy, zz) = Foo (); + } + + static (int, long) Foo () + { + return (1, 3); + } +}
\ No newline at end of file diff --git a/mcs/errors/cs8132.cs b/mcs/errors/cs8132.cs index be9e522aec4..3855d31159c 100644 --- a/mcs/errors/cs8132.cs +++ b/mcs/errors/cs8132.cs @@ -1,4 +1,4 @@ -// CS8132: +// CS8132: Cannot deconstruct a tuple of `2' elements into `3' variables // Line: 8 class C diff --git a/mcs/errors/cs8199.cs b/mcs/errors/cs8199.cs new file mode 100644 index 00000000000..3d89c68c696 --- /dev/null +++ b/mcs/errors/cs8199.cs @@ -0,0 +1,10 @@ +// CS8199: The syntax `var (...)' as an lvalue is reserved +// Line: 8 + +class X +{ + public static void Main () + { + var (x.a, y) = (1, 'g'); + } +}
\ No newline at end of file diff --git a/mcs/errors/known-issues-net_4_x b/mcs/errors/known-issues-net_4_x index 9282fd4adb9..40f81ded970 100644 --- a/mcs/errors/known-issues-net_4_x +++ b/mcs/errors/known-issues-net_4_x @@ -19,7 +19,6 @@ cs0457-2.cs cs0457.cs cs8129.cs NO ERROR -cs8132.cs NO ERROR cs8141.cs cs8141-2.cs cs8144.cs |