Skip to content

Commit d48745d

Browse files
RexJaeschkeBillWagner
authored andcommitted
Support assignment and declaration in same deconstruction
1 parent 34c67a8 commit d48745d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

standard/expressions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6896,7 +6896,7 @@ The `=` operator is called the simple assignment operator.
68966896

68976897
If the left operand of a simple assignment is of the form `E.P` or `E[Ei]` where `E` has the compile-time type `dynamic`, then the assignment is dynamically bound ([§12.3.3](expressions.md#1233-dynamic-binding)). In this case, the compile-time type of the assignment expression is `dynamic`, and the resolution described below will take place at run-time based on the run-time type of `E`. If the left operand is of the form `E[Ei]` where at least one element of `Ei` has the compile-time type `dynamic`, and the compile-time type of `E` is not an array, the resulting indexer access is dynamically bound, but with limited compile-time checking ([§12.6.5](expressions.md#1265-compile-time-checking-of-dynamic-member-invocation)).
68986898

6899-
A simple assignment where the left operand is classified as a tuple is also called a ***deconstructing assignment***. If any of the tuple elements of the left operand has an element name, a compile-time error occurs. If any of the tuple elements of the left operand is a *declaration_expression* and any other element is not a *declaration_expression* or a simple discard, a compile-time error occurs.
6899+
A simple assignment where the left operand is classified as a tuple is also called a ***deconstructing assignment***. If any of the tuple elements of the left operand has an element name, a compile-time error occurs.
69006900

69016901
The type of a simple assignment `x = y` is the type of an assignment to `x` of `y`, which is recursively determined as follows:
69026902

0 commit comments

Comments
 (0)