Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Deconstruct assignment requires an expression with a type on the right-hand-side.
The following sample generates CS8131:
// CS8131.cs (5,24)
class Program
{
static void Main()
{
var (x2, y2) = () => { };
}
}
The compiler cannot convert a delegate (Action
) to a two-element tuple, resulting in CS8131.
To assign a value to a tuple, ensure the right-hand-side expression is the same type of tuple as that on the left-hand-side:
static void Main()
{
var (x2, y2) = (1, 2);
}
.NET feedback
.NET is an open source project. Select a link to provide feedback: