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
Copy file name to clipboardExpand all lines: standard/expressions.md
+29-5Lines changed: 29 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3083,7 +3083,7 @@ An *anonymous_method_expression* is one of two ways of defining an anonymous fun
3083
3083
3084
3084
### 11.8.1 General
3085
3085
3086
-
The `+`, `-`, `!`, `~`, `++`, `--`, cast, and `await` operatorsarecalledtheunaryoperators.
3086
+
The `+`, `-`, `!`, `~`, `^`, `++`, `--`, cast, and `await` operatorsarecalledtheunaryoperators.
3087
3087
3088
3088
```ANTLR
3089
3089
unary_expression
@@ -3092,6 +3092,7 @@ unary_expression
3092
3092
|'-'unary_expression
3093
3093
|'!'unary_expression
3094
3094
|'~'unary_expression
3095
+
|'^'unary_expression
3095
3096
|pre_increment_expression
3096
3097
|pre_decrement_expression
3097
3098
|cast_expression
@@ -3363,7 +3364,10 @@ At run-time, the expression `await t` is evaluated as follows:
3363
3364
An awaiter’s implementation of the interface methods `INotifyCompletion.OnCompleted` and `ICriticalNotifyCompletion.UnsafeOnCompleted` should cause the delegate `r` to be invoked at most once. Otherwise, the behavior of the enclosing async function is undefined.
3364
3365
3365
3366
<<<<<<< HEAD
3367
+
<<<<<<< HEAD
3368
+
=======
3366
3369
=======
3370
+
>>>>>>> 50008cc (add indexers and ranges)
3367
3371
## §range-operator Range operator
3368
3372
3369
3373
This operator provides a succinct syntax for specifying a (possibly empty) element range suitable for use in denoting a slice of an indexable sequence (§indexable-sequence).
@@ -3381,36 +3385,56 @@ For an operation of the form `s .. e`, binary operator overload resolution ([§1
The left and right operands denote, respectively, a start and end Index. For this operator, an object of (the immutable struct) type `System.Range` is returned that contains those Indexes. If the left operand is omitted, an Index of `0` is used. If the right operand is omitted, an Index of `^0` is used. As such,
3385
3390
3386
3391
-`s .. e` is transformed by the implementation to `new System.Range(s, e)`.
3387
3392
-`s ..` is transformed by the implementation to `new System.Range(s, ^0)` (or to `System.Range.StartAt(s)` if that method exists, is accessible, and is declared as follows: `public static Range StartAt (Index start);`).
3388
3393
-`.. e` is transformed by the implementation to `new System.Range(0, e)` (or to `System.Range.EndAt(e)` if that method exists, is accessible, and is declared as follows: `public static Range EndAt (Index end);`).
3389
3394
-`..` is transformed by the implementation to `new System.Range(0, ^0)` (or instead to `System.Range.All` if that property exists, is accessible, and is declared as follows: `public static Range All { get; }`).
3395
+
=======
3396
+
The left and right operands denote, respectively, a start and end Index. For this operator, an object of (the immutable struct) type `System.Range` is returned that contains those Indexes. If the left operand is omitted, an Index of `0` is used. If the right operand is omitted, an Index of `^0` is used. As such,
3397
+
-`s .. e` is transformed by the implementation to `new System.Range(s, e)`.
3398
+
-`s ..` is transformed by the implementation to `new System.Range(s, ^0)` (or to ` System.Range.StartAt(s)` if that method exists, is accessible, and is declared as follows: `public static Range StartAt (Index start);`).
3399
+
-`.. e` is transformed by the implementation to `new System.Range(0, e)` (or to ` System.Range.EndAt(e)` if that method exists, is accessible, and is declared as follows: `public static Range EndAt (Index end);`).
3400
+
-`..` is transformed by the implementation to `new System.Range(0, ^0)` (or instead to ` System.Range.All` if that property exists, is accessible, and is declared as follows: `public static Range All { get; }`).
3401
+
>>>>>>> 50008cc (add indexers and ranges)
3390
3402
3391
3403
> *Note*: While a Range can be created with a start Index greater than the end Index, any attempt to use that Range to denote a slice from an indexable sequence will result in `System.ArgumentOutOfRangeException`. *end note*
3392
3404
3393
3405
Lifted ([§11.4.8](expressions.md#1148-lifted-operators)) forms of the unlifted predefined range operator defined above are also predefined.
3394
3406
3395
3407
> *Example*: The following example uses array and string indexable sequences:
0 commit comments