You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-Otherwise, if `Ei` isoftheform `Ni` or `E.Ni` or `E?.Ni` thenthetupletypeelementshallbe `TiNi`, *unless*anyofthefollowingholds:
1739
-
-Anotherelementofthetupleexpressionhasthename `Ni`, or
1740
-
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Ni` or `E.Ni` or `E?.Ni`, or
1741
-
- `Ni` isoftheform `ItemX`, where `X` isasequenceofnon-`0`-initiateddecimaldigitsthatcouldrepresentthepositionofatupleelement, and `X` doesnotrepresentthepositionoftheelement.
-Otherwise, if `Eᵢ` isoftheform `Nᵢ` or `E.Nᵢ` or `E?.Nᵢ` thenthetupletypeelementshallbe `Tᵢ Nᵢ`, *unless*anyofthefollowingholds:
1739
+
-Anotherelementofthetupleexpressionhasthename `Nᵢ`, or
1740
+
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Nᵢ` or `E.Nᵢ` or `E?.Nᵢ`, or
1741
+
- `Nᵢ` isoftheform `ItemX`, where `X` isasequenceofnon-`0`-initiateddecimaldigitsthatcouldrepresentthepositionofatupleelement, and `X` doesnotrepresentthepositionoftheelement.
> *Note*: There is a grammar ambiguity between *type* and *constant_pattern* in a `relational_expression` on the right-hand-side of `is`; either might be a valid parse of a qualified identifier. In such a case, only if it fails to bind as a type (for compatibility with previous versions of the language), is it resolved to be the first thing found (which must be either a constant or a type). This ambiguity is only present on the right-hand side of such an expression.
4591
+
> *Note*: There is a grammar ambiguity between *type* and *constant_pattern* in a `relational_expression` on the right-hand-side of `is`; either might be a valid parse of a qualified identifier. In such a case, only if it fails to bind as a type (for compatibility with previous versions of the language), is it resolved to be the first thing found (which must be either a constant or a type). This ambiguity is only present on the right-hand side of such an expression.*end note*
4592
4592
4593
4593
The `is` operator is described in [§12.15.12](expressions.md#121512-the-is-operator) and the `as` operator is described in [§12.15.13](expressions.md#121513-the-as-operator).
4594
4594
@@ -4923,16 +4923,16 @@ The tuple equality operators are applied pairwise to the elements of the tuple o
4923
4923
4924
4924
If each operand `x` and `y` of a `==` or `!=` operator is classified either as a tuple or as a value with a tuple type ([§8.3.11](types.md#8311-tuple-types)), the operator is a *tuple equality operator*.
4925
4925
4926
-
If an operand `e` is classified as a tuple, the elements `e1...en` shall be the results of evaluating the element expressions of the tuple expression. Otherwise if `e` is a value of a tuple type, the elements shall be `t.Item1...t.Itemn` where `t` is the result of evaluating `e`.
4926
+
If an operand `e` is classified as a tuple, the elements `e₁...eₙ` shall be the results of evaluating the element expressions of the tuple expression. Otherwise if `e` is a value of a tuple type, the elements shall be `t.Item1...t.Itemn` where `t` is the result of evaluating `e`.
4927
4927
4928
-
The operands `x` and `y` of a tuple equality operator shall have the same arity, or a compile time error occurs. For each pair of elements `xi` and `yi`, the same equality operator shall apply, and shall yield a result of type `bool`, `dynamic`, a type that has an implicit conversion to `bool`, or a type that defines the `true` and `false` operators.
4928
+
The operands `x` and `y` of a tuple equality operator shall have the same arity, or a compile time error occurs. For each pair of elements `xᵢ` and `yᵢ`, the same equality operator shall apply, and shall yield a result of type `bool`, `dynamic`, a type that has an implicit conversion to `bool`, or a type that defines the `true` and `false` operators.
4929
4929
4930
4930
The tuple equality operator `x == y` is evaluated as follows:
4931
4931
4932
4932
- The left side operand `x` is evaluated.
4933
4933
- The right side operand `y` is evaluated.
4934
-
- For each pair of elements `xi` and `yi` in lexical order:
4935
-
- The operator `xi == yi` is evaluated, and a result of type `bool` is obtained in the following way:
4934
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4935
+
- The operator `xᵢ == yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4936
4936
- If the comparison yielded a `bool` then that is the result.
4937
4937
- Otherwise if the comparison yielded a `dynamic` then the operator `false` is dynamically invoked on it, and the resulting `bool` value is negated with the logical negation operator (`!`).
4938
4938
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -4944,8 +4944,8 @@ The tuple equality operator `x != y` is evaluated as follows:
4944
4944
4945
4945
- The left side operand `x` is evaluated.
4946
4946
- The right side operand `y` is evaluated.
4947
-
- For each pair of elements `xi` and `yi` in lexical order:
4948
-
- The operator `xi != yi` is evaluated, and a result of type `bool` is obtained in the following way:
4947
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4948
+
- The operator `xᵢ != yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4949
4949
- If the comparison yielded a `bool` then that is the result.
4950
4950
- Otherwise if the comparison yielded a `dynamic` then the operator `true` is dynamically invoked on it, and the resulting `bool` value is the result.
4951
4951
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -7080,24 +7080,25 @@ When a property or indexer declared in a *struct_type* is the target of an assig
7080
7080
> ```csharp
7081
7081
> structPoint
7082
7082
> {
7083
-
> intx, y;
7083
+
> intx, y;
7084
7084
>
7085
-
>publicPoint(intx, inty)
7086
-
> {
7087
-
>this.x=x;
7088
-
>this.y=y;
7089
-
> }
7085
+
>publicPoint(intx, inty)
7086
+
>{
7087
+
>this.x=x;
7088
+
>this.y=y;
7089
+
>}
7090
7090
>
7091
-
>publicintX
7092
-
> {
7093
-
>get { returnx; }
7094
-
>set { x=value; }
7095
-
> }
7091
+
>publicintX
7092
+
>{
7093
+
>get { returnx; }
7094
+
>set { x=value; }
7095
+
>}
7096
7096
>
7097
-
>publicintY {
7098
-
>get { returny; }
7099
-
>set { y=value; }
7100
-
> }
7097
+
>publicintY
7098
+
> {
7099
+
>get { returny; }
7100
+
>set { y=value; }
7101
+
> }
7101
7102
> }
7102
7103
>
7103
7104
>structRectangle
@@ -7181,17 +7182,18 @@ The ref assignment operator shall not read the storage location referenced by th
7181
7182
>publicstaticrefreadonlyintM3() { ... }
7182
7183
>publicstaticvoidTest()
7183
7184
> {
7184
-
>intv=42;
7185
-
>refintr1=refv; // OK, r1 refers to v, which has value 42
7186
-
>r1=refM1(); // Error; M1 returns a value, not a reference
7187
-
>r1=refM2(); // OK; makes an alias
7188
-
>r1=refM2u(); // Error; lhs and rhs have different types
7189
-
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
7190
-
>refreadonlyintr2=refv; // OK; make readonly alias to ref
7191
-
>r2=refM2(); // OK; makes an alias, adding read-only protection
7192
-
>r2=refM3(); // OK; makes an alias and honors the read-only
7193
-
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
7194
-
>// r2 is an alias (with read-only access) to the same variable
7185
+
>intv=42;
7186
+
>refintr1=refv; // OK, r1 refers to v, which has value 42
7187
+
>r1=refM1(); // Error; M1 returns a value, not a reference
7188
+
>r1=refM2(); // OK; makes an alias
7189
+
>r1=refM2u(); // Error; lhs and rhs have different types
7190
+
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
7191
+
>refreadonlyintr2=refv; // OK; make readonly alias to ref
7192
+
>r2=refM2(); // OK; makes an alias, adding read-only protection
7193
+
>r2=refM3(); // OK; makes an alias and honors the read-only
7194
+
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
0 commit comments