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:
1644
-
-Anotherelementofthetupleexpressionhasthename `Ni`, or
1645
-
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Ni` or `E.Ni` or `E?.Ni`, or
1646
-
- `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:
1644
+
-Anotherelementofthetupleexpressionhasthename `Nᵢ`, or
1645
+
-Anothertupleelementwithoutanamehasatupleelementexpressionoftheform `Nᵢ` or `E.Nᵢ` or `E?.Nᵢ`, or
1646
+
- `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.
4425
+
> *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*
4426
4426
4427
4427
The `is` operator is described in [§12.14.12](expressions.md#121412-the-is-operator) and the `as` operator is described in [§12.14.13](expressions.md#121413-the-as-operator).
4428
4428
@@ -4751,16 +4751,16 @@ The tuple equality operators are applied pairwise to the elements of the tuple o
4751
4751
4752
4752
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*.
4753
4753
4754
-
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`.
4754
+
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`.
4755
4755
4756
-
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.
4756
+
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.
4757
4757
4758
4758
The tuple equality operator `x == y` is evaluated as follows:
4759
4759
4760
4760
- The left side operand `x` is evaluated.
4761
4761
- The right side operand `y` is evaluated.
4762
-
- For each pair of elements `xi` and `yi` in lexical order:
4763
-
- The operator `xi == yi` is evaluated, and a result of type `bool` is obtained in the following way:
4762
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4763
+
- The operator `xᵢ == yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4764
4764
- If the comparison yielded a `bool` then that is the result.
4765
4765
- 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 (`!`).
4766
4766
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -4772,8 +4772,8 @@ The tuple equality operator `x != y` is evaluated as follows:
4772
4772
4773
4773
- The left side operand `x` is evaluated.
4774
4774
- The right side operand `y` is evaluated.
4775
-
- For each pair of elements `xi` and `yi` in lexical order:
4776
-
- The operator `xi != yi` is evaluated, and a result of type `bool` is obtained in the following way:
4775
+
- For each pair of elements `xᵢ` and `yᵢ` in lexical order:
4776
+
- The operator `xᵢ != yᵢ` is evaluated, and a result of type `bool` is obtained in the following way:
4777
4777
- If the comparison yielded a `bool` then that is the result.
4778
4778
- Otherwise if the comparison yielded a `dynamic` then the operator `true` is dynamically invoked on it, and the resulting `bool` value is the result.
4779
4779
- Otherwise, if the type of the comparison has an implicit conversion to `bool`, that conversion is applied.
@@ -6819,24 +6819,25 @@ When a property or indexer declared in a *struct_type* is the target of an assig
6819
6819
> ```csharp
6820
6820
> structPoint
6821
6821
> {
6822
-
> intx, y;
6822
+
> intx, y;
6823
6823
>
6824
-
>publicPoint(intx, inty)
6825
-
> {
6826
-
>this.x=x;
6827
-
>this.y=y;
6828
-
> }
6824
+
>publicPoint(intx, inty)
6825
+
>{
6826
+
>this.x=x;
6827
+
>this.y=y;
6828
+
>}
6829
6829
>
6830
-
>publicintX
6831
-
> {
6832
-
>get { returnx; }
6833
-
>set { x=value; }
6834
-
> }
6830
+
>publicintX
6831
+
>{
6832
+
>get { returnx; }
6833
+
>set { x=value; }
6834
+
>}
6835
6835
>
6836
-
>publicintY {
6837
-
>get { returny; }
6838
-
>set { y=value; }
6839
-
> }
6836
+
>publicintY
6837
+
> {
6838
+
>get { returny; }
6839
+
>set { y=value; }
6840
+
> }
6840
6841
> }
6841
6842
>
6842
6843
>structRectangle
@@ -6920,17 +6921,18 @@ The ref assignment operator shall not read the storage location referenced by th
6920
6921
>publicstaticrefreadonlyintM3() { ... }
6921
6922
>publicstaticvoidTest()
6922
6923
> {
6923
-
>intv=42;
6924
-
>refintr1=refv; // OK, r1 refers to v, which has value 42
6925
-
>r1=refM1(); // Error; M1 returns a value, not a reference
6926
-
>r1=refM2(); // OK; makes an alias
6927
-
>r1=refM2u(); // Error; lhs and rhs have different types
6928
-
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
6929
-
>refreadonlyintr2=refv; // OK; make readonly alias to ref
6930
-
>r2=refM2(); // OK; makes an alias, adding read-only protection
6931
-
>r2=refM3(); // OK; makes an alias and honors the read-only
6932
-
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
6933
-
>// r2 is an alias (with read-only access) to the same variable
6924
+
>intv=42;
6925
+
>refintr1=refv; // OK, r1 refers to v, which has value 42
6926
+
>r1=refM1(); // Error; M1 returns a value, not a reference
6927
+
>r1=refM2(); // OK; makes an alias
6928
+
>r1=refM2u(); // Error; lhs and rhs have different types
6929
+
>r1=refM3(); // error; M3 returns a ref readonly, which r1 cannot honor
6930
+
>refreadonlyintr2=refv; // OK; make readonly alias to ref
6931
+
>r2=refM2(); // OK; makes an alias, adding read-only protection
6932
+
>r2=refM3(); // OK; makes an alias and honors the read-only
6933
+
>r2=ref (r1=refM2()); // OK; r1 is an alias to a writable variable,
0 commit comments