Skip to content

Commit 2d97105

Browse files
authored
Explain better conversion from collection expression (#42995)
* Explain better conversion from collection expression Fixes #42819 * fix warnings from C# standard update We merged part of NRT into the C# standard repo. Fix the ripple effects of renumbering sections.
1 parent 8a67306 commit 2d97105

File tree

8 files changed

+10
-9
lines changed

8 files changed

+10
-9
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ You can use the `checked` modifier only when you overload any of the following o
277277

278278
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
279279

280-
- [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#12815-postfix-increment-and-decrement-operators)
280+
- [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#12816-postfix-increment-and-decrement-operators)
281281
- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1296-prefix-increment-and-decrement-operators)
282282
- [Unary plus operator](~/_csharpstandard/standard/expressions.md#1292-unary-plus-operator)
283283
- [Unary minus operator](~/_csharpstandard/standard/expressions.md#1293-unary-minus-operator)
@@ -287,7 +287,7 @@ For more information, see the following sections of the [C# language specificati
287287
- [Addition operator](~/_csharpstandard/standard/expressions.md#12105-addition-operator)
288288
- [Subtraction operator](~/_csharpstandard/standard/expressions.md#12106-subtraction-operator)
289289
- [Compound assignment](~/_csharpstandard/standard/expressions.md#12214-compound-assignment)
290-
- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12819-the-checked-and-unchecked-operators)
290+
- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12820-the-checked-and-unchecked-operators)
291291
- [Numeric promotions](~/_csharpstandard/standard/expressions.md#1247-numeric-promotions)
292292

293293
## See also

docs/csharp/language-reference/operators/collection-expressions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ The compiler uses static analysis to determine the most performant way to create
5353

5454
Many APIs are overloaded with multiple collection types as parameters. Because a collection expression can be converted to many different expression types, these APIs might require casts on the collection expression to specify the correct conversion. The following conversion rules resolve some of the ambiguities:
5555

56+
- A better element conversion is preferred over a better collection type conversion. In other words, the type of elements in the collection expression has more importance than the type of the collection. These rules are described in the feature spec for [better conversion from collection expression](~/_csharplang/proposals/csharp-13.0/collection-expressions-better-conversion.md).
5657
- Conversion to <xref:System.Span%601>, <xref:System.ReadOnlySpan%601>, or another [`ref struct`](../builtin-types/ref-struct.md) type is better than a conversion to a non-ref struct type.
5758
- Conversion to a noninterface type is better than a conversion to an interface type.
5859

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following example shows the usage of the `default` literal:
3737
3838
## C# language specification
3939

40-
For more information, see the [Default value expressions](~/_csharpstandard/standard/expressions.md#12820-default-value-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md).
40+
For more information, see the [Default value expressions](~/_csharpstandard/standard/expressions.md#12821-default-value-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md).
4141

4242
## See also
4343

docs/csharp/language-reference/operators/member-access-operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ The `.`, `()`, `^`, and `..` operators can't be overloaded. The `[]` operator is
250250
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
251251

252252
- [Member access](~/_csharpstandard/standard/expressions.md#1287-member-access)
253-
- [Element access](~/_csharpstandard/standard/expressions.md#12811-element-access)
253+
- [Element access](~/_csharpstandard/standard/expressions.md#12812-element-access)
254254
- [Null-conditional member access](~/_csharpstandard/standard/expressions.md#1288-null-conditional-member-access)
255-
- [Invocation expressions](~/_csharpstandard/standard/expressions.md#1289-invocation-expressions)
255+
- [Invocation expressions](~/_csharpstandard/standard/expressions.md#12810-invocation-expressions)
256256

257257
For more information about indices and ranges, see the [feature proposal note](~/_csharplang/proposals/csharp-8.0/ranges.md).
258258

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ When the operand is a [verbatim identifier](../tokens/verbatim.md), the `@` char
3232

3333
## C# language specification
3434

35-
For more information, see the [Nameof expressions](~/_csharpstandard/standard/expressions.md#12822-the-nameof-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md), and the [C# 11 - Extended `nameof` scope](~/_csharplang/proposals/csharp-11.0/extended-nameof-scope.md) feature specification.
35+
For more information, see the [Nameof expressions](~/_csharpstandard/standard/expressions.md#12823-the-nameof-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md), and the [C# 11 - Extended `nameof` scope](~/_csharplang/proposals/csharp-11.0/extended-nameof-scope.md) feature specification.
3636

3737
## See also
3838

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ A user-defined type can't overload the `new` operator.
6262

6363
## C# language specification
6464

65-
For more information, see [The new operator](~/_csharpstandard/standard/expressions.md#12816-the-new-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md).
65+
For more information, see [The new operator](~/_csharpstandard/standard/expressions.md#12817-the-new-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md).
6666

6767
For more information about a target-typed `new` expression, see the [feature proposal note](~/_csharplang/proposals/csharp-9.0/target-typed-new.md).
6868

docs/csharp/language-reference/operators/type-testing-and-cast.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ For more information, see the following sections of the [C# language specificati
148148
- [The is operator](~/_csharpstandard/standard/expressions.md#121212-the-is-operator)
149149
- [The as operator](~/_csharpstandard/standard/expressions.md#121213-the-as-operator)
150150
- [Cast expressions](~/_csharpstandard/standard/expressions.md#1297-cast-expressions)
151-
- [The typeof operator](~/_csharpstandard/standard/expressions.md#12817-the-typeof-operator)
151+
- [The typeof operator](~/_csharpstandard/standard/expressions.md#12818-the-typeof-operator)
152152

153153
## See also
154154

docs/csharp/language-reference/statements/checked-and-unchecked.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Constant expressions are evaluated by default in a checked context and a compile
5555
For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md):
5656

5757
- [The checked and unchecked statements](~/_csharpstandard/standard/statements.md#1312-the-checked-and-unchecked-statements)
58-
- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12819-the-checked-and-unchecked-operators)
58+
- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12820-the-checked-and-unchecked-operators)
5959
- [User-defined checked and unchecked operators - C# 11](~/_csharplang/proposals/csharp-11.0/checked-user-defined-operators.md)
6060

6161
## See also

0 commit comments

Comments
 (0)