Skip to content

Commit 4c133f9

Browse files
committed
update the description of Slice.
1 parent a6d87c0 commit 4c133f9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

proposals/csharp-8.0/ranges.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ This value will be re-used in the calculation of the second `Slice` argument. Wh
234234

235235
- When `expr` is of the form `expr1..expr2` (where `expr1` can be omitted) and `expr2` has type `int`, then it will be emitted as `expr2 - start`.
236236
- When `expr` is of the form `expr1..^expr2` (where `expr1` can be omitted), then it will be emitted as `(receiver.Length - expr2) - start`.
237-
- When `expr` is of the form `expr1..` (where `expr1` can be omitted), then it will be emitted as `receiver.Length`.
237+
- When `expr` is of the form `expr1..` (where `expr1` can be omitted), then it will be emitted as `receiver.Length - start`.
238238
- Otherwise, it will be emitted as `expr.End.GetOffset(receiver.Length) - start`.
239239

240240
The `receiver`, `Length` and `expr` expressions will be spilled as appropriate to ensure any side effects are only executed once. For example:
@@ -277,10 +277,6 @@ The language will special case the following known types:
277277
- `string`: the method `Substring` will be used instead of `Slice`.
278278
- `array`: the method `System.Reflection.CompilerServices.GetSubArray` will be used instead of `Slice`.
279279

280-
281-
282-
283-
284280
## Alternatives
285281

286282
The new operators (`^` and `..`) are syntactic sugar. The functionality can be implemented by explicit calls to `System.Index` and `System.Range` factory methods, but it will result in a lot more boilerplate code, and the experience will be unintuitive.

0 commit comments

Comments
 (0)