Skip to content

Commit cf04e99

Browse files
authored
Remove ranges and indices (#48453)
* Remove ranges and indices Fast follow to merging dotnet/csharpstandard#1369 * fix anchors to standard
1 parent b57c2eb commit cf04e99

36 files changed

+70
-71
lines changed

.openpublishing.redirection.csharp.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
{
4848
"source_path_from_root": "/redirections/proposals/csharp-7.2/conditional-ref.md",
49-
"redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1218-conditional-operator"
49+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1219-conditional-operator"
5050
},
5151
{
5252
"source_path_from_root": "/redirections/proposals/csharp-7.2/non-trailing-named-arguments.md",
@@ -94,7 +94,7 @@
9494
},
9595
{
9696
"source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md",
97-
"redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#237-the-fixed-statement"
97+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#247-the-fixed-statement"
9898
},
9999
{
100100
"source_path_from_root": "/redirections/proposals/csharp-7.3/ref-local-reassignment.md",
@@ -122,7 +122,7 @@
122122
},
123123
{
124124
"source_path_from_root": "/redirections/proposals/csharp-8.0/null-coalescing-assignment.md",
125-
"redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1221-assignment-operators"
125+
"redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1222-assignment-operators"
126126
},
127127
{
128128
"source_path_from_root": "/redirections/proposals/csharp-8.0/async-streams.md",

docfx.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"csharp-8.0/readonly-instance-members.md",
7878
"csharp-8.0/null-coalescing-assignment.md",
7979
"csharp-8.0/async-streams.md",
80+
"csharp-8.0/ranges.md",
8081
"csharp-9.0/nullable-reference-types-specification.md",
8182
"csharp-9.0/nullable-constructor-analysis.md",
8283
"csharp-9.0/nullable-parameter-default-value-analysis.md",
@@ -622,6 +623,7 @@
622623
"_csharpstandard/standard/classes.md": "Classes",
623624
"_csharpstandard/standard/structs.md": "Structs",
624625
"_csharpstandard/standard/arrays.md": "Arrays",
626+
"_csharpstandard/standard/ranges.md": "Indexes and ranges",
625627
"_csharpstandard/standard/interfaces.md": "Interfaces",
626628
"_csharpstandard/standard/enums.md": "Enums",
627629
"_csharpstandard/standard/delegates.md": "Delegates",
@@ -635,7 +637,6 @@
635637
"_csharpstandard/standard/Bibliography.md": "Bibliography",
636638
"_csharplang/proposals/csharp-8.0/patterns.md": "Recursive pattern matching",
637639
"_csharplang/proposals/csharp-8.0/default-interface-methods.md": "Default interface methods",
638-
"_csharplang/proposals/csharp-8.0/ranges.md": "Ranges and indices",
639640
"_csharplang/proposals/csharp-8.0/using.md": "Pattern based using and using declarations",
640641
"_csharplang/proposals/csharp-9.0/covariant-returns.md": "Covariant return types",
641642
"_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "Extending partial methods",
@@ -749,7 +750,8 @@
749750
"_csharpstandard/standard/namespaces.md": "This chapter defines namespaces, including how to declare them and how to use them.",
750751
"_csharpstandard/standard/classes.md": "This chapter covers class declarations, including all member types that can be included in classes. This includes generic classes as well as non-generic classes.",
751752
"_csharpstandard/standard/structs.md": "This chapter defines struct declarations. In many cases, the descriptions are defined using the differences between classes and structs.",
752-
"_csharpstandard/standard/arrays.md": "This chapter defines arrays. It includes the rules for array variance, multi-dimensional arrays and jagged arrays.",
753+
"_csharpstandard/standard/arrays.md": "This chapter defines arrays. It includes the rules for array variance, multi-dimensional arrays, and jagged arrays.",
754+
"_csharpstandard/standard/ranges.md": "This chapter defines the index and range operators for indexing into arrays, strings, and spans.",
753755
"_csharpstandard/standard/interfaces.md": "This chapter defines interfaces. This includes interface declarations, implementing interfaces, and explicit interface implementation.",
754756
"_csharpstandard/standard/enums.md": "This chapter defines the enum types in C#. Enums create a set of named constants and are represented by an underlying integral set of values.",
755757
"_csharpstandard/standard/delegates.md": "This chapter defines delegates, which are objects that hold type safe function pointers.",
@@ -763,7 +765,6 @@
763765
"_csharpstandard/standard/Bibliography.md": "This appendix lists external standards referenced in this specification.",
764766
"_csharplang/proposals/csharp-8.0/patterns.md": "This feature specification describes recursive pattern matching, where patterns can nest inside other patterns.",
765767
"_csharplang/proposals/csharp-8.0/default-interface-methods.md": "This feature specification describe the syntax updates necessary to support default interface methods. This includes declaring bodies in interface declarations, and supporting modifiers on declarations.",
766-
"_csharplang/proposals/csharp-8.0/ranges.md": "This feature specification describes the syntax for ranges and indices, which support indexing individual elements of a sequence or a range of a sequence from the start or end of that sequence.",
767768
"_csharplang/proposals/csharp-8.0/using.md": "This feature specification supports pattern based using and using declarations to simplify resource cleanup.",
768769
"_csharplang/proposals/csharp-9.0/covariant-returns.md": "This feature specification describes covariant return types, where overriding member declarations can return a type derived from the overridden member declaration.",
769770
"_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "This feature specification describes extensions to partial methods. These extensions enable source generators to create or call partial methods.",

docs/csharp/advanced-topics/reflection-and-attributes/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ For example, the following code shows three equivalent `DllImport` attributes:
113113
[DllImport("user32.dll", ExactSpelling=false, SetLastError=false)]
114114
```
115115

116-
The first parameter, the DLL name, is positional and always comes first. The other instances are named parameters. In this scenario, both named parameters default to false, so they can be omitted. Refer to the individual attribute's documentation for information on default parameter values. For more information on allowed parameter types, see the [Attributes](~/_csharpstandard/standard/attributes.md#2224-attribute-parameter-types) section of the [C# language specification](~/_csharpstandard/standard/README.md).
116+
The first parameter, the DLL name, is positional and always comes first. The other instances are named parameters. In this scenario, both named parameters default to false, so they can be omitted. Refer to the individual attribute's documentation for information on default parameter values. For more information on allowed parameter types, see the [Attributes](~/_csharpstandard/standard/attributes.md#2324-attribute-parameter-types) section of the [C# language specification](~/_csharpstandard/standard/README.md).
117117

118118
### Attribute targets
119119

docs/csharp/asynchronous-programming/async-return-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The following example shows the behavior of an async event handler. In the examp
7373

7474
An async method can return any type that has an accessible `GetAwaiter` method that returns an instance of an *awaiter type*. In addition, the returned type must match the type of the parameter of `SetResult` and returned type of the `Task` property on the type specified by the <xref:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute?displayProperty=nameWithType> attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the C# spec for the [Task type builder pattern](~/_csharpstandard/standard/classes.md#15142-task-type-builder-pattern).
7575

76-
This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md#12982-awaitable-expressions), which describes the requirements for the operand of `await`. Generalized async return types enable the compiler to generate `async` methods that return different types. Generalized async return types enabled performance improvements in the .NET libraries. Because <xref:System.Threading.Tasks.Task> and <xref:System.Threading.Tasks.Task%601> are reference types, memory allocation in performance-critical paths, particularly when allocations occur in tight loops, can adversely affect performance. Support for generalized return types means that you can return a lightweight value type instead of a reference type to avoid more memory allocations.
76+
This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md#12992-awaitable-expressions), which describes the requirements for the operand of `await`. Generalized async return types enable the compiler to generate `async` methods that return different types. Generalized async return types enabled performance improvements in the .NET libraries. Because <xref:System.Threading.Tasks.Task> and <xref:System.Threading.Tasks.Task%601> are reference types, memory allocation in performance-critical paths, particularly when allocations occur in tight loops, can adversely affect performance. Support for generalized return types means that you can return a lightweight value type instead of a reference type to avoid more memory allocations.
7777

7878
.NET provides the <xref:System.Threading.Tasks.ValueTask%601?displayProperty=nameWithType> structure as a lightweight implementation of a generalized task-returning value. The following example uses the <xref:System.Threading.Tasks.ValueTask%601> structure to retrieve the value of two dice rolls.
7979

docs/csharp/language-reference/builtin-types/enum.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ For any enumeration type, there exist [boxing and unboxing](../../programming-gu
8787
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
8888

8989
- [Enums](~/_csharpstandard/standard/enums.md)
90-
- [Enum values and operations](~/_csharpstandard/standard/enums.md#196-enum-values-and-operations)
91-
- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#12133-enumeration-logical-operators)
92-
- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#12126-enumeration-comparison-operators)
90+
- [Enum values and operations](~/_csharpstandard/standard/enums.md#206-enum-values-and-operations)
91+
- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#12143-enumeration-logical-operators)
92+
- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#12136-enumeration-comparison-operators)
9393
- [Explicit enumeration conversions](~/_csharpstandard/standard/conversions.md#1033-explicit-enumeration-conversions)
9494
- [Implicit enumeration conversions](~/_csharpstandard/standard/conversions.md#1024-implicit-enumeration-conversions)
9595

docs/csharp/language-reference/builtin-types/unmanaged-types.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ A generic struct may be the source of both unmanaged and managed constructed typ
2727

2828
## C# language specification
2929

30-
For more information, see the [Pointer types](~/_csharpstandard/standard/unsafe-code.md#233-pointer-types) section of the [C# language specification](~/_csharpstandard/standard/README.md).
30+
For more information, see the [Pointer types](~/_csharpstandard/standard/unsafe-code.md#243-pointer-types) section of the [C# language specification](~/_csharpstandard/standard/README.md).
3131

3232
## See also
3333

docs/csharp/language-reference/keywords/const.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ The following example demonstrates how to declare a local constant:
6363
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
6464

6565
- [Constants](~/_csharpstandard/standard/classes.md#154-constants)
66-
- [Constant expressions](~/_csharpstandard/standard/expressions.md#1223-constant-expressions)
66+
- [Constant expressions](~/_csharpstandard/standard/expressions.md#1224-constant-expressions)
6767

6868
## See also
6969

docs/csharp/language-reference/operators/addition-operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ A user-defined type can [overload](operator-overloading.md) the `+` operator. Wh
7272

7373
## C# language specification
7474

75-
For more information, see the [Unary plus operator](~/_csharpstandard/standard/expressions.md#1292-unary-plus-operator) and [Addition operator](~/_csharpstandard/standard/expressions.md#12105-addition-operator) sections of the [C# language specification](~/_csharpstandard/standard/README.md). For more information on overloading the compound assignment operators in C# 14 and later, see the [user defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) feature specification.
75+
For more information, see the [Unary plus operator](~/_csharpstandard/standard/expressions.md#1292-unary-plus-operator) and [Addition operator](~/_csharpstandard/standard/expressions.md#12115-addition-operator) sections of the [C# language specification](~/_csharpstandard/standard/README.md). For more information on overloading the compound assignment operators in C# 14 and later, see the [user defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) feature specification.
7676

7777
## See also
7878

docs/csharp/language-reference/operators/arithmetic-operators.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ For the `float` and `double` operands, the result of `x % y` for the finite `x`
138138
> [!NOTE]
139139
> This method of computing the remainder is analogous to the method used for integer operands, but different from the IEEE 754 specification. If you need the remainder operation that complies with the IEEE 754 specification, use the <xref:System.Math.IEEERemainder%2A?displayProperty=nameWithType> method.
140140
141-
For information about the behavior of the `%` operator with non-finite operands, see the [Remainder operator](~/_csharpstandard/standard/expressions.md#12104-remainder-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md).
141+
For information about the behavior of the `%` operator with non-finite operands, see the [Remainder operator](~/_csharpstandard/standard/expressions.md#12114-remainder-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md).
142142

143143
For the `decimal` operands, the remainder operator `%` is equivalent to the [remainder operator](<xref:System.Decimal.op_Modulus(System.Decimal,System.Decimal)>) of the <xref:System.Decimal?displayProperty=nameWithType> type.
144144

@@ -279,15 +279,15 @@ You can use the `checked` modifier only when you overload any of the following o
279279
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
280280

281281
- [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#12816-postfix-increment-and-decrement-operators)
282-
- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1296-prefix-increment-and-decrement-operators)
282+
- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1297-prefix-increment-and-decrement-operators)
283283
- [Unary plus operator](~/_csharpstandard/standard/expressions.md#1292-unary-plus-operator)
284284
- [Unary minus operator](~/_csharpstandard/standard/expressions.md#1293-unary-minus-operator)
285-
- [Multiplication operator](~/_csharpstandard/standard/expressions.md#12102-multiplication-operator)
286-
- [Division operator](~/_csharpstandard/standard/expressions.md#12103-division-operator)
287-
- [Remainder operator](~/_csharpstandard/standard/expressions.md#12104-remainder-operator)
288-
- [Addition operator](~/_csharpstandard/standard/expressions.md#12105-addition-operator)
289-
- [Subtraction operator](~/_csharpstandard/standard/expressions.md#12106-subtraction-operator)
290-
- [Compound assignment](~/_csharpstandard/standard/expressions.md#12214-compound-assignment)
285+
- [Multiplication operator](~/_csharpstandard/standard/expressions.md#12112-multiplication-operator)
286+
- [Division operator](~/_csharpstandard/standard/expressions.md#12113-division-operator)
287+
- [Remainder operator](~/_csharpstandard/standard/expressions.md#12114-remainder-operator)
288+
- [Addition operator](~/_csharpstandard/standard/expressions.md#12115-addition-operator)
289+
- [Subtraction operator](~/_csharpstandard/standard/expressions.md#12116-subtraction-operator)
290+
- [Compound assignment](~/_csharpstandard/standard/expressions.md#12224-compound-assignment)
291291
- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12820-the-checked-and-unchecked-operators)
292292
- [Numeric promotions](~/_csharpstandard/standard/expressions.md#1247-numeric-promotions)
293293
- [User defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md)

docs/csharp/language-reference/operators/assignment-operator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ If a user-defined type overloads a binary operator `op`, the `op=` operator, if
8181

8282
## C# language specification
8383

84-
For more information, see the [Assignment operators](~/_csharpstandard/standard/expressions.md#1221-assignment-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md) and the [User defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) feature specification.
84+
For more information, see the [Assignment operators](~/_csharpstandard/standard/expressions.md#1222-assignment-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md) and the [User defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) feature specification.
8585

8686
## See also
8787

0 commit comments

Comments
 (0)