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:
1686
-
-Anotherelementofthetupleexpressionhasthename `Ni`, or
1687
-
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Ni` or `E.Ni` or `E?.Ni`, or
1688
-
- `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:
1686
+
-Anotherelementofthetupleexpressionhasthename `Nᵢ`, or
1687
+
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Nᵢ` or `E.Nᵢ` or `E?.Nᵢ`, or
1688
+
- `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.
4537
+
> *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*
4538
4538
4539
4539
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).
4540
4540
@@ -4869,16 +4869,16 @@ The tuple equality operators are applied pairwise to the elements of the tuple o
4869
4869
4870
4870
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*.
4871
4871
4872
-
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`.
4872
+
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`.
4873
4873
4874
-
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.
4874
+
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.
4875
4875
4876
4876
The tuple equality operator `x == y` is evaluated as follows:
4877
4877
4878
4878
- The left side operand `x` is evaluated.
4879
4879
- The right side operand `y` is evaluated.
4880
-
- For each pair of elements `xi` and `yi` in lexical order:
4881
-
- The operator `xi == yi` is evaluated, and a result of type `bool` is obtained in the following way:
4880
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4881
+
- The operator `xᵢ == yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4882
4882
- If the comparison yielded a `bool` then that is the result.
4883
4883
- 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 (`!`).
4884
4884
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -4890,8 +4890,8 @@ The tuple equality operator `x != y` is evaluated as follows:
4890
4890
4891
4891
- The left side operand `x` is evaluated.
4892
4892
- The right side operand `y` is evaluated.
4893
-
- For each pair of elements `xi` and `yi` in lexical order:
4894
-
- The operator `xi != yi` is evaluated, and a result of type `bool` is obtained in the following way:
4893
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4894
+
- The operator `xᵢ != yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4895
4895
- If the comparison yielded a `bool` then that is the result.
4896
4896
- Otherwise if the comparison yielded a `dynamic` then the operator `true` is dynamically invoked on it, and the resulting `bool` value is the result.
4897
4897
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -6954,24 +6954,25 @@ When a property or indexer declared in a *struct_type* is the target of an assig
6954
6954
> ```csharp
6955
6955
> structPoint
6956
6956
> {
6957
-
> intx, y;
6957
+
> intx, y;
6958
6958
>
6959
-
>publicPoint(intx, inty)
6960
-
> {
6961
-
>this.x=x;
6962
-
>this.y=y;
6963
-
> }
6959
+
>publicPoint(intx, inty)
6960
+
>{
6961
+
>this.x=x;
6962
+
>this.y=y;
6963
+
>}
6964
6964
>
6965
-
>publicintX
6966
-
> {
6967
-
>get { returnx; }
6968
-
>set { x=value; }
6969
-
> }
6965
+
>publicintX
6966
+
>{
6967
+
>get { returnx; }
6968
+
>set { x=value; }
6969
+
>}
6970
6970
>
6971
-
>publicintY {
6972
-
>get { returny; }
6973
-
>set { y=value; }
6974
-
> }
6971
+
>publicintY
6972
+
> {
6973
+
>get { returny; }
6974
+
>set { y=value; }
6975
+
> }
6975
6976
> }
6976
6977
>
6977
6978
>structRectangle
@@ -7055,17 +7056,18 @@ The ref assignment operator shall not read the storage location referenced by th
7055
7056
>publicstaticrefreadonlyintM3() { ... }
7056
7057
>publicstaticvoidTest()
7057
7058
> {
7058
-
>intv=42;
7059
-
>refintr1=refv; // OK, r1 refers to v, which has value 42
7060
-
>r1=refM1(); // Error; M1 returns a value, not a reference
7061
-
>r1=refM2(); // OK; makes an alias
7062
-
>r1=refM2u(); // Error; lhs and rhs have different types
7063
-
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
7064
-
>refreadonlyintr2=refv; // OK; make readonly alias to ref
7065
-
>r2=refM2(); // OK; makes an alias, adding read-only protection
7066
-
>r2=refM3(); // OK; makes an alias and honors the read-only
7067
-
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
7068
-
>// r2 is an alias (with read-only access) to the same variable
7059
+
>intv=42;
7060
+
>refintr1=refv; // OK, r1 refers to v, which has value 42
7061
+
>r1=refM1(); // Error; M1 returns a value, not a reference
7062
+
>r1=refM2(); // OK; makes an alias
7063
+
>r1=refM2u(); // Error; lhs and rhs have different types
7064
+
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
7065
+
>refreadonlyintr2=refv; // OK; make readonly alias to ref
7066
+
>r2=refM2(); // OK; makes an alias, adding read-only protection
7067
+
>r2=refM3(); // OK; makes an alias and honors the read-only
7068
+
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
0 commit comments