I'm using Visual Studio 2017 RC and I have installed the System.ValueTuple
package which enables the new c# 7.0 tuple usage, but I can't make it work in this specific case:
As you can see, the first method doesn't have any red squigglies and it just works. But trying to do o is (string, Color)
fails with unrelated errors:
Can the new tuples not be used in this way? Or is it just the current state of the package? I have updated it to the latest version btw, which is 4.3.0 at this time. I've read this MSDN post but didn't find any such usage.
Roslyn contains tests that ensure using tuples in pattern matching does cause errors (added in this PR, which does not explain anything), so it seems this is currently the expected behavior. I'm not sure what is the reason for that, or if the final version of C# 7.0 is planned to behave like this. It certainly is something that I would expect to work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With