var (ret, err) = Foo();
if (err != null) {
...
} var (ret, err) = Foo();
if (err != null) {
...
}EDIT: I don't know C#, so syntax is definitely not right.
But yes you can write a deconstructor for anything you like so it can participate in deconstructing assignment. And yes it can have side effects. And that would be VERY BAD.
So instead of having to declare that Foo returns a FooReturn, it can be declared as (say)
public (int ret, string err) Foo() { return (5, "something"); }EDIT: Looks like there's confusion... Yes, you can deconstruct a Tuple like this, but C# 7 also introduces a specific Deconstructor pattern in which ANY class can be deconstructed as though it were a Tuple.