diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 1dc2c75ffeecf..b98367dfd9bed 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -46,7 +46,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/conditional-ref.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1218-conditional-operator" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1219-conditional-operator" }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/non-trailing-named-arguments.md", @@ -94,7 +94,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#237-the-fixed-statement" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#247-the-fixed-statement" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/ref-local-reassignment.md", @@ -122,7 +122,7 @@ }, { "source_path_from_root": "/redirections/proposals/csharp-8.0/null-coalescing-assignment.md", - "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1221-assignment-operators" + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#1222-assignment-operators" }, { "source_path_from_root": "/redirections/proposals/csharp-8.0/async-streams.md", diff --git a/docfx.json b/docfx.json index 705126f1e19c5..e727064b3baaf 100644 --- a/docfx.json +++ b/docfx.json @@ -77,6 +77,7 @@ "csharp-8.0/readonly-instance-members.md", "csharp-8.0/null-coalescing-assignment.md", "csharp-8.0/async-streams.md", + "csharp-8.0/ranges.md", "csharp-9.0/nullable-reference-types-specification.md", "csharp-9.0/nullable-constructor-analysis.md", "csharp-9.0/nullable-parameter-default-value-analysis.md", @@ -622,6 +623,7 @@ "_csharpstandard/standard/classes.md": "Classes", "_csharpstandard/standard/structs.md": "Structs", "_csharpstandard/standard/arrays.md": "Arrays", + "_csharpstandard/standard/ranges.md": "Indexes and ranges", "_csharpstandard/standard/interfaces.md": "Interfaces", "_csharpstandard/standard/enums.md": "Enums", "_csharpstandard/standard/delegates.md": "Delegates", @@ -635,7 +637,6 @@ "_csharpstandard/standard/Bibliography.md": "Bibliography", "_csharplang/proposals/csharp-8.0/patterns.md": "Recursive pattern matching", "_csharplang/proposals/csharp-8.0/default-interface-methods.md": "Default interface methods", - "_csharplang/proposals/csharp-8.0/ranges.md": "Ranges and indices", "_csharplang/proposals/csharp-8.0/using.md": "Pattern based using and using declarations", "_csharplang/proposals/csharp-9.0/covariant-returns.md": "Covariant return types", "_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "Extending partial methods", @@ -749,7 +750,8 @@ "_csharpstandard/standard/namespaces.md": "This chapter defines namespaces, including how to declare them and how to use them.", "_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.", "_csharpstandard/standard/structs.md": "This chapter defines struct declarations. In many cases, the descriptions are defined using the differences between classes and structs.", - "_csharpstandard/standard/arrays.md": "This chapter defines arrays. It includes the rules for array variance, multi-dimensional arrays and jagged arrays.", + "_csharpstandard/standard/arrays.md": "This chapter defines arrays. It includes the rules for array variance, multi-dimensional arrays, and jagged arrays.", + "_csharpstandard/standard/ranges.md": "This chapter defines the index and range operators for indexing into arrays, strings, and spans.", "_csharpstandard/standard/interfaces.md": "This chapter defines interfaces. This includes interface declarations, implementing interfaces, and explicit interface implementation.", "_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.", "_csharpstandard/standard/delegates.md": "This chapter defines delegates, which are objects that hold type safe function pointers.", @@ -763,7 +765,6 @@ "_csharpstandard/standard/Bibliography.md": "This appendix lists external standards referenced in this specification.", "_csharplang/proposals/csharp-8.0/patterns.md": "This feature specification describes recursive pattern matching, where patterns can nest inside other patterns.", "_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.", - "_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.", "_csharplang/proposals/csharp-8.0/using.md": "This feature specification supports pattern based using and using declarations to simplify resource cleanup.", "_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.", "_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.", diff --git a/docs/csharp/advanced-topics/reflection-and-attributes/index.md b/docs/csharp/advanced-topics/reflection-and-attributes/index.md index 3314666324872..06958d4c026ae 100644 --- a/docs/csharp/advanced-topics/reflection-and-attributes/index.md +++ b/docs/csharp/advanced-topics/reflection-and-attributes/index.md @@ -113,7 +113,7 @@ For example, the following code shows three equivalent `DllImport` attributes: [DllImport("user32.dll", ExactSpelling=false, SetLastError=false)] ``` -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). +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). ### Attribute targets diff --git a/docs/csharp/asynchronous-programming/async-return-types.md b/docs/csharp/asynchronous-programming/async-return-types.md index c88d6fb9243f6..b0c8387cdb2c3 100644 --- a/docs/csharp/asynchronous-programming/async-return-types.md +++ b/docs/csharp/asynchronous-programming/async-return-types.md @@ -73,7 +73,7 @@ The following example shows the behavior of an async event handler. In the examp 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 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). -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 and 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. +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 and 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. .NET provides the structure as a lightweight implementation of a generalized task-returning value. The following example uses the structure to retrieve the value of two dice rolls. diff --git a/docs/csharp/language-reference/builtin-types/enum.md b/docs/csharp/language-reference/builtin-types/enum.md index 236c8958cc45a..55a3f86ce7737 100644 --- a/docs/csharp/language-reference/builtin-types/enum.md +++ b/docs/csharp/language-reference/builtin-types/enum.md @@ -87,9 +87,9 @@ For any enumeration type, there exist [boxing and unboxing](../../programming-gu For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [Enums](~/_csharpstandard/standard/enums.md) -- [Enum values and operations](~/_csharpstandard/standard/enums.md#196-enum-values-and-operations) -- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#12133-enumeration-logical-operators) -- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#12126-enumeration-comparison-operators) +- [Enum values and operations](~/_csharpstandard/standard/enums.md#206-enum-values-and-operations) +- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#12143-enumeration-logical-operators) +- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#12136-enumeration-comparison-operators) - [Explicit enumeration conversions](~/_csharpstandard/standard/conversions.md#1033-explicit-enumeration-conversions) - [Implicit enumeration conversions](~/_csharpstandard/standard/conversions.md#1024-implicit-enumeration-conversions) diff --git a/docs/csharp/language-reference/builtin-types/unmanaged-types.md b/docs/csharp/language-reference/builtin-types/unmanaged-types.md index 97e30d813e70b..b7a9852b409fc 100644 --- a/docs/csharp/language-reference/builtin-types/unmanaged-types.md +++ b/docs/csharp/language-reference/builtin-types/unmanaged-types.md @@ -27,7 +27,7 @@ A generic struct may be the source of both unmanaged and managed constructed typ ## C# language specification -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). +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). ## See also diff --git a/docs/csharp/language-reference/keywords/const.md b/docs/csharp/language-reference/keywords/const.md index abce400e9d4f4..4f940157f2f32 100644 --- a/docs/csharp/language-reference/keywords/const.md +++ b/docs/csharp/language-reference/keywords/const.md @@ -63,7 +63,7 @@ The following example demonstrates how to declare a local constant: For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [Constants](~/_csharpstandard/standard/classes.md#154-constants) -- [Constant expressions](~/_csharpstandard/standard/expressions.md#1223-constant-expressions) +- [Constant expressions](~/_csharpstandard/standard/expressions.md#1224-constant-expressions) ## See also diff --git a/docs/csharp/language-reference/operators/addition-operator.md b/docs/csharp/language-reference/operators/addition-operator.md index 9bced4a3457d1..d17c85579c35a 100644 --- a/docs/csharp/language-reference/operators/addition-operator.md +++ b/docs/csharp/language-reference/operators/addition-operator.md @@ -72,7 +72,7 @@ A user-defined type can [overload](operator-overloading.md) the `+` operator. Wh ## C# language specification -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. +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. ## See also diff --git a/docs/csharp/language-reference/operators/arithmetic-operators.md b/docs/csharp/language-reference/operators/arithmetic-operators.md index ddb2a74d2f169..19340e3d067c5 100644 --- a/docs/csharp/language-reference/operators/arithmetic-operators.md +++ b/docs/csharp/language-reference/operators/arithmetic-operators.md @@ -138,7 +138,7 @@ For the `float` and `double` operands, the result of `x % y` for the finite `x` > [!NOTE] > 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 method. -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). +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). For the `decimal` operands, the remainder operator `%` is equivalent to the [remainder operator]() of the type. @@ -279,15 +279,15 @@ You can use the `checked` modifier only when you overload any of the following o For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#12816-postfix-increment-and-decrement-operators) -- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1296-prefix-increment-and-decrement-operators) +- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1297-prefix-increment-and-decrement-operators) - [Unary plus operator](~/_csharpstandard/standard/expressions.md#1292-unary-plus-operator) - [Unary minus operator](~/_csharpstandard/standard/expressions.md#1293-unary-minus-operator) -- [Multiplication operator](~/_csharpstandard/standard/expressions.md#12102-multiplication-operator) -- [Division operator](~/_csharpstandard/standard/expressions.md#12103-division-operator) -- [Remainder operator](~/_csharpstandard/standard/expressions.md#12104-remainder-operator) -- [Addition operator](~/_csharpstandard/standard/expressions.md#12105-addition-operator) -- [Subtraction operator](~/_csharpstandard/standard/expressions.md#12106-subtraction-operator) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#12214-compound-assignment) +- [Multiplication operator](~/_csharpstandard/standard/expressions.md#12112-multiplication-operator) +- [Division operator](~/_csharpstandard/standard/expressions.md#12113-division-operator) +- [Remainder operator](~/_csharpstandard/standard/expressions.md#12114-remainder-operator) +- [Addition operator](~/_csharpstandard/standard/expressions.md#12115-addition-operator) +- [Subtraction operator](~/_csharpstandard/standard/expressions.md#12116-subtraction-operator) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#12224-compound-assignment) - [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#12820-the-checked-and-unchecked-operators) - [Numeric promotions](~/_csharpstandard/standard/expressions.md#1247-numeric-promotions) - [User defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) diff --git a/docs/csharp/language-reference/operators/assignment-operator.md b/docs/csharp/language-reference/operators/assignment-operator.md index d5c47a98de594..2bdf08a57ea6b 100644 --- a/docs/csharp/language-reference/operators/assignment-operator.md +++ b/docs/csharp/language-reference/operators/assignment-operator.md @@ -81,7 +81,7 @@ If a user-defined type overloads a binary operator `op`, the `op=` operator, if ## C# language specification -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. +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. ## See also diff --git a/docs/csharp/language-reference/operators/await.md b/docs/csharp/language-reference/operators/await.md index ac4d2609c01d2..24c70c7a43f9c 100644 --- a/docs/csharp/language-reference/operators/await.md +++ b/docs/csharp/language-reference/operators/await.md @@ -16,7 +16,7 @@ In the following example, the , , , or . However, any awaitable expression can be the operand of the `await` operator. For more information, see the [Awaitable expressions](~/_csharpstandard/standard/expressions.md#12982-awaitable-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +The operand of the `await` operator is usually of one of the following .NET types: , , , or . However, any awaitable expression can be the operand of the `await` operator. For more information, see the [Awaitable expressions](~/_csharpstandard/standard/expressions.md#12992-awaitable-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). The type of expression `await t` is `TResult` if the type of expression `t` is or . If the type of `t` is or , the type of `await t` is `void`. In both cases, if `t` throws an exception, `await t` rethrows the exception. @@ -41,7 +41,7 @@ The [`Main` method](../../fundamentals/program-structure/main-command-line.md), ## C# language specification -For more information, see the [Await expressions](~/_csharpstandard/standard/expressions.md#1298-await-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Await expressions](~/_csharpstandard/standard/expressions.md#1299-await-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md index bc5bb6ca730d0..95a1102d5c306 100644 --- a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md +++ b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md @@ -195,9 +195,9 @@ If a user-defined type `T` overloads the `<<`, `>>`, or `>>>` operator, the type For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [Bitwise complement operator](~/_csharpstandard/standard/expressions.md#1295-bitwise-complement-operator) -- [Shift operators](~/_csharpstandard/standard/expressions.md#1211-shift-operators) -- [Logical operators](~/_csharpstandard/standard/expressions.md#1213-logical-operators) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#12214-compound-assignment) +- [Shift operators](~/_csharpstandard/standard/expressions.md#1212-shift-operators) +- [Logical operators](~/_csharpstandard/standard/expressions.md#1214-logical-operators) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#12224-compound-assignment) - [Numeric promotions](~/_csharpstandard/standard/expressions.md#1247-numeric-promotions) - [C# 11 - Relaxed shift requirements](~/_csharplang/proposals/csharp-11.0/relaxing_shift_operator_requirements.md) - [C# 11 - Logical right-shift operator](~/_csharplang/proposals/csharp-11.0/unsigned-right-shift-operator.md) diff --git a/docs/csharp/language-reference/operators/boolean-logical-operators.md b/docs/csharp/language-reference/operators/boolean-logical-operators.md index 751c63970a1c8..6bce21c600369 100644 --- a/docs/csharp/language-reference/operators/boolean-logical-operators.md +++ b/docs/csharp/language-reference/operators/boolean-logical-operators.md @@ -184,16 +184,16 @@ For the complete list of C# operators ordered by precedence level, see the [Oper A user-defined type can [overload](operator-overloading.md) the `!`, `&`, `|`, and `^` operators. When a binary operator is overloaded, the corresponding compound assignment operator is also implicitly overloaded. Beginning with C# 14, a user-defined type can explicitly overload the compound assignment operators to provide a more efficient implementation. Typically, a type overloads these operators because the value can be updated in place, rather than allocating a new instance to hold the result of the binary operation. If a type doesn't provide an explicit overload, the compiler generates the implicit overload. -A user-defined type can't overload the conditional logical operators `&&` and `||`. However, if a user-defined type overloads the [true and false operators](true-false-operators.md) and the `&` or `|` operator in a certain way, the `&&` or `||` operation, respectively, can be evaluated for the operands of that type. For more information, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12143-user-defined-conditional-logical-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +A user-defined type can't overload the conditional logical operators `&&` and `||`. However, if a user-defined type overloads the [true and false operators](true-false-operators.md) and the `&` or `|` operator in a certain way, the `&&` or `||` operation, respectively, can be evaluated for the operands of that type. For more information, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12153-user-defined-conditional-logical-operators ) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## C# language specification For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [Logical negation operator](~/_csharpstandard/standard/expressions.md#1294-logical-negation-operator) -- [Logical operators](~/_csharpstandard/standard/expressions.md#1213-logical-operators) -- [Conditional logical operators](~/_csharpstandard/standard/expressions.md#1214-conditional-logical-operators) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#12214-compound-assignment) +- [Logical operators](~/_csharpstandard/standard/expressions.md#1214-logical-operators) +- [Conditional logical operators](~/_csharpstandard/standard/expressions.md#1215-conditional-logical-operators) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#12224-compound-assignment) - [User defined compound assignment](~/_csharplang/proposals/csharp-14.0/user-defined-compound-assignment.md) ## See also diff --git a/docs/csharp/language-reference/operators/comparison-operators.md b/docs/csharp/language-reference/operators/comparison-operators.md index 0b194758d2c00..736e9c84f765f 100644 --- a/docs/csharp/language-reference/operators/comparison-operators.md +++ b/docs/csharp/language-reference/operators/comparison-operators.md @@ -65,7 +65,7 @@ If a type overloads one of the `<` or `>` operators, it must overload both `<` a ## C# language specification -For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1212-relational-and-type-testing-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1213-relational-and-type-testing-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/conditional-operator.md b/docs/csharp/language-reference/operators/conditional-operator.md index 3b7a1c0d25596..88f35bd3fdfa4 100644 --- a/docs/csharp/language-reference/operators/conditional-operator.md +++ b/docs/csharp/language-reference/operators/conditional-operator.md @@ -79,7 +79,7 @@ A user-defined type can't overload the conditional operator. ## C# language specification -For more information, see the [Conditional operator](~/_csharpstandard/standard/expressions.md#1218-conditional-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Conditional operator](~/_csharpstandard/standard/expressions.md#1219-conditional-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). Specifications for newer features are: diff --git a/docs/csharp/language-reference/operators/delegate-operator.md b/docs/csharp/language-reference/operators/delegate-operator.md index 577908cb15bfc..e0b995b259fa8 100644 --- a/docs/csharp/language-reference/operators/delegate-operator.md +++ b/docs/csharp/language-reference/operators/delegate-operator.md @@ -57,7 +57,7 @@ Action a = () => StaticFunction(); ## C# language specification -For more information, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1219-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1220-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/equality-operators.md b/docs/csharp/language-reference/operators/equality-operators.md index 081b5253798bf..7abe34a036f3f 100644 --- a/docs/csharp/language-reference/operators/equality-operators.md +++ b/docs/csharp/language-reference/operators/equality-operators.md @@ -76,7 +76,7 @@ Two [delegate](../../programming-guide/delegates/index.md) operands of the same :::code language="csharp" interactive="try-dotnet-method" source="snippets/shared/EqualityOperators.cs" id="SnippetCheckReceiver"::: -For more information, see the [Delegate equality operators](~/_csharpstandard/standard/expressions.md#12129-delegate-equality-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Delegate equality operators](~/_csharpstandard/standard/expressions.md#12139-delegate-equality-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). Delegates that are produced from evaluation of semantically identical [lambda expressions](lambda-expressions.md) aren't equal, as the following example shows: @@ -102,7 +102,7 @@ public virtual bool Equals(T? other); ## C# language specification -For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1212-relational-and-type-testing-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1213-relational-and-type-testing-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about equality of record types, see the [Equality members](~/_csharplang/proposals/csharp-9.0/records.md#equality-members) section of the [records feature proposal note](~/_csharplang/proposals/csharp-9.0/records.md). diff --git a/docs/csharp/language-reference/operators/is.md b/docs/csharp/language-reference/operators/is.md index 9b711ddeae71f..fbbba7271d9ad 100644 --- a/docs/csharp/language-reference/operators/is.md +++ b/docs/csharp/language-reference/operators/is.md @@ -43,7 +43,7 @@ The `is` operator can be useful in the following scenarios: ## C# language specification -For more information, see [The is operator](~/_csharpstandard/standard/expressions.md#121212-the-is-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md) and [Pattern matching](/dotnet/csharp/language-reference/language-specification/patterns). +For more information, see [The is operator](~/_csharpstandard/standard/expressions.md#121312-the-is-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md) and [Pattern matching](/dotnet/csharp/language-reference/language-specification/patterns). ## See also diff --git a/docs/csharp/language-reference/operators/lambda-expressions.md b/docs/csharp/language-reference/operators/lambda-expressions.md index 1b8bd39687187..684f68211bd78 100644 --- a/docs/csharp/language-reference/operators/lambda-expressions.md +++ b/docs/csharp/language-reference/operators/lambda-expressions.md @@ -323,7 +323,7 @@ A static lambda can't capture local variables or instance state from enclosing s ## C# language specification -For more information, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1219-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1220-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about these features, see the following feature proposal notes: diff --git a/docs/csharp/language-reference/operators/lambda-operator.md b/docs/csharp/language-reference/operators/lambda-operator.md index 2adbcdc8998ac..87b4e0ce07c31 100644 --- a/docs/csharp/language-reference/operators/lambda-operator.md +++ b/docs/csharp/language-reference/operators/lambda-operator.md @@ -72,7 +72,7 @@ The `=>` operator can't be overloaded. ## C# language specification -For more information about the lambda operator, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1219-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information about the lambda operator, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1220-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/member-access-operators.md b/docs/csharp/language-reference/operators/member-access-operators.md index 3d9d4f999ee7d..f86f54f164c6b 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -271,7 +271,7 @@ For more information, see the following sections of the [C# language specificati - [Null-conditional member access](~/_csharpstandard/standard/expressions.md#1288-null-conditional-member-access) - [Invocation expressions](~/_csharpstandard/standard/expressions.md#12810-invocation-expressions) -For more information about indices and ranges, see the [feature proposal note](~/_csharplang/proposals/csharp-8.0/ranges.md). +For more information about indices and ranges, see the [feature proposal note](~/_csharpstandard/standard/ranges.md). ## See also diff --git a/docs/csharp/language-reference/operators/null-coalescing-operator.md b/docs/csharp/language-reference/operators/null-coalescing-operator.md index fdf464e33c070..709cee25fb479 100644 --- a/docs/csharp/language-reference/operators/null-coalescing-operator.md +++ b/docs/csharp/language-reference/operators/null-coalescing-operator.md @@ -82,7 +82,7 @@ The operators `??` and `??=` can't be overloaded. ## C# language specification -For more information about the `??` operator, see [The null coalescing operator](~/_csharpstandard/standard/expressions.md#1215-the-null-coalescing-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information about the `??` operator, see [The null coalescing operator](~/_csharpstandard/standard/expressions.md#1216-the-null-coalescing-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about the `??=` operator, see the [feature proposal note](~/_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md). diff --git a/docs/csharp/language-reference/operators/operator-overloading.md b/docs/csharp/language-reference/operators/operator-overloading.md index d99257a9fcf5d..7247452e65830 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -59,7 +59,7 @@ The following table shows the operators that can't be overloaded: | Operators | Alternatives | | :---------: | --------------- | -|[`x && y`](boolean-logical-operators.md#conditional-logical-and-operator-), [x || y](boolean-logical-operators.md#conditional-logical-or-operator-)| Overload both the [`true`](true-false-operators.md) and [`false`](true-false-operators.md) operators and the [`&`](boolean-logical-operators.md#logical-and-operator-) or [|](boolean-logical-operators.md#logical-or-operator-) operators. For more information, see [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12143-user-defined-conditional-logical-operators).| +|[`x && y`](boolean-logical-operators.md#conditional-logical-and-operator-), [x || y](boolean-logical-operators.md#conditional-logical-or-operator-)| Overload both the [`true`](true-false-operators.md) and [`false`](true-false-operators.md) operators and the [`&`](boolean-logical-operators.md#logical-and-operator-) or [|](boolean-logical-operators.md#logical-or-operator-) operators. For more information, see [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12153-user-defined-conditional-logical-operators ).| |[a[i]](member-access-operators.md#indexer-operator-), [`a?[i]`](member-access-operators.md#null-conditional-operators--and-)|Define an [indexer](../../programming-guide/indexers/index.md).| |[`(T)x`](type-testing-and-cast.md#cast-expression)|Define custom type conversions performed by a cast expression. For more information, see [User-defined conversion operators](user-defined-conversion-operators.md).| |[`^x`](member-access-operators.md#index-from-end-operator-), [`x = y`](assignment-operator.md), [`x.y`](member-access-operators.md#member-access-expression-), [`x?.y`](member-access-operators.md#null-conditional-operators--and-), [`c ? t : f`](conditional-operator.md), [`x ?? y`](null-coalescing-operator.md), [`??= y`](null-coalescing-operator.md),
[`x..y`](member-access-operators.md#range-operator-), [`x->y`](pointer-related-operators.md#pointer-member-access-operator--), [`=>`](lambda-operator.md), [`f(x)`](member-access-operators.md#invocation-expression-), [`as`](type-testing-and-cast.md#the-as-operator), [`await`](await.md), [`checked`](../statements/checked-and-unchecked.md), [`unchecked`](../statements/checked-and-unchecked.md), [`default`](default.md), [`delegate`](delegate-operator.md), [`is`](type-testing-and-cast.md#the-is-operator), [`nameof`](nameof.md), [`new`](new-operator.md),
[`sizeof`](sizeof.md), [`stackalloc`](stackalloc.md), [`switch`](switch-expression.md), [`typeof`](type-testing-and-cast.md#the-typeof-operator), [`with`](with-expression.md)|None.| diff --git a/docs/csharp/language-reference/operators/pointer-related-operators.md b/docs/csharp/language-reference/operators/pointer-related-operators.md index 8d41a0c5543a0..cc0dc939c1ba3 100644 --- a/docs/csharp/language-reference/operators/pointer-related-operators.md +++ b/docs/csharp/language-reference/operators/pointer-related-operators.md @@ -50,7 +50,7 @@ The operand of the `&` operator must be a fixed variable. *Fixed* variables are You can't get the address of a constant or a value. -For more information about fixed and movable variables, see the [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#234-fixed-and-moveable-variables) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information about fixed and movable variables, see the [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#244-fixed-and-moveable-variables) section of the [C# language specification](~/_csharpstandard/standard/README.md). The binary `&` operator computes the [logical AND](boolean-logical-operators.md#logical-and-operator-) of its Boolean operands or the [bitwise logical AND](bitwise-and-shift-operators.md#logical-and-operator-) of its integral operands. @@ -172,14 +172,14 @@ A user-defined type can't overload the pointer related operators `&`, `*`, `->`, For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): -- [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#234-fixed-and-moveable-variables) -- [The address-of operator](~/_csharpstandard/standard/unsafe-code.md#2365-the-address-of-operator) -- [Pointer indirection](~/_csharpstandard/standard/unsafe-code.md#2362-pointer-indirection) -- [Pointer member access](~/_csharpstandard/standard/unsafe-code.md#2363-pointer-member-access) -- [Pointer element access](~/_csharpstandard/standard/unsafe-code.md#2364-pointer-element-access) -- [Pointer arithmetic](~/_csharpstandard/standard/unsafe-code.md#2367-pointer-arithmetic) -- [Pointer increment and decrement](~/_csharpstandard/standard/unsafe-code.md#2366-pointer-increment-and-decrement) -- [Pointer comparison](~/_csharpstandard/standard/unsafe-code.md#2368-pointer-comparison) +- [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#244-fixed-and-moveable-variables) +- [The address-of operator](~/_csharpstandard/standard/unsafe-code.md#2465-the-address-of-operator) +- [Pointer indirection](~/_csharpstandard/standard/unsafe-code.md#2462-pointer-indirection) +- [Pointer member access](~/_csharpstandard/standard/unsafe-code.md#2463-pointer-member-access) +- [Pointer element access](~/_csharpstandard/standard/unsafe-code.md#2464-pointer-element-access) +- [Pointer arithmetic](~/_csharpstandard/standard/unsafe-code.md#2467-pointer-arithmetic) +- [Pointer increment and decrement](~/_csharpstandard/standard/unsafe-code.md#2466-pointer-increment-and-decrement) +- [Pointer comparison](~/_csharpstandard/standard/unsafe-code.md#2468-pointer-comparison) ## See also diff --git a/docs/csharp/language-reference/operators/sizeof.md b/docs/csharp/language-reference/operators/sizeof.md index 8ce45f912157a..aa6b4d8a9e4e8 100644 --- a/docs/csharp/language-reference/operators/sizeof.md +++ b/docs/csharp/language-reference/operators/sizeof.md @@ -46,7 +46,7 @@ In unsafe code, when the argument is a managed type, the `sizeof` operator retur ## C# language specification -For more information, see [The sizeof operator](~/_csharpstandard/standard/unsafe-code.md#2369-the-sizeof-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see [The sizeof operator](~/_csharpstandard/standard/unsafe-code.md#2469-the-sizeof-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/stackalloc.md b/docs/csharp/language-reference/operators/stackalloc.md index edec7417fa8e9..c346c40261315 100644 --- a/docs/csharp/language-reference/operators/stackalloc.md +++ b/docs/csharp/language-reference/operators/stackalloc.md @@ -66,7 +66,7 @@ The use of `stackalloc` automatically enables buffer overrun detection features ## C# language specification -For more information, see the [Stack allocation](~/_csharpstandard/standard/unsafe-code.md#239-stack-allocation) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Stack allocation](~/_csharpstandard/standard/unsafe-code.md#249-stack-allocation) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/subtraction-operator.md b/docs/csharp/language-reference/operators/subtraction-operator.md index bebeeaaa0ce0b..c65aa465f978d 100644 --- a/docs/csharp/language-reference/operators/subtraction-operator.md +++ b/docs/csharp/language-reference/operators/subtraction-operator.md @@ -31,7 +31,7 @@ For operands of the same [delegate](../builtin-types/reference-types.md#the-dele :::code interactive="try-dotnet-method" language="csharp" source="snippets/shared/SubtractionOperator.cs" id="DelegateRemovalNoChange"::: - The preceding example also demonstrates that during delegate removal delegate instances are compared. For example, delegates that are produced from evaluation of identical [lambda expressions](lambda-expressions.md) aren't equal. For more information about delegate equality, see the [Delegate equality operators](~/_csharpstandard/standard/expressions.md#12129-delegate-equality-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). + The preceding example also demonstrates that during delegate removal delegate instances are compared. For example, delegates that are produced from evaluation of identical [lambda expressions](lambda-expressions.md) aren't equal. For more information about delegate equality, see the [Delegate equality operators](~/_csharpstandard/standard/expressions.md#12139-delegate-equality-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). - If the left-hand operand is `null`, the result of the operation is `null`. If the right-hand operand is `null`, the result of the operation is the left-hand operand. @@ -69,7 +69,7 @@ A user-defined type can [overload](operator-overloading.md) the `-` operator. Wh ## C# language specification -For more information, see the [Unary minus operator](~/_csharpstandard/standard/expressions.md#1293-unary-minus-operator) and [Subtraction operator](~/_csharpstandard/standard/expressions.md#12106-subtraction-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. +For more information, see the [Unary minus operator](~/_csharpstandard/standard/expressions.md#1293-unary-minus-operator) and [Subtraction operator](~/_csharpstandard/standard/expressions.md#12116-subtraction-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. ## See also diff --git a/docs/csharp/language-reference/operators/true-false-operators.md b/docs/csharp/language-reference/operators/true-false-operators.md index 1fdfa4669a124..ccdf47829b525 100644 --- a/docs/csharp/language-reference/operators/true-false-operators.md +++ b/docs/csharp/language-reference/operators/true-false-operators.md @@ -21,11 +21,11 @@ The `true` and `false` operators aren't guaranteed to complement each other. Tha ## Boolean expressions -A type with the defined `true` operator can be the type of a result of a controlling conditional expression in the [if](../statements/selection-statements.md#the-if-statement), [do](../statements/iteration-statements.md#the-do-statement), [while](../statements/iteration-statements.md#the-while-statement), and [for](../statements/iteration-statements.md#the-for-statement) statements and in the [conditional operator `?:`](conditional-operator.md). For more information, see the [Boolean expressions](~/_csharpstandard/standard/expressions.md#1224-boolean-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +A type with the defined `true` operator can be the type of a result of a controlling conditional expression in the [if](../statements/selection-statements.md#the-if-statement), [do](../statements/iteration-statements.md#the-do-statement), [while](../statements/iteration-statements.md#the-while-statement), and [for](../statements/iteration-statements.md#the-for-statement) statements and in the [conditional operator `?:`](conditional-operator.md). For more information, see the [Boolean expressions](~/_csharpstandard/standard/expressions.md#1225-boolean-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## User-defined conditional logical operators -If a type with the defined `true` and `false` operators [overloads](operator-overloading.md) the [logical OR operator](boolean-logical-operators.md#logical-or-operator-) `|` or the [logical AND operator](boolean-logical-operators.md#logical-and-operator-) `&` in a certain way, the [conditional logical OR operator](boolean-logical-operators.md#conditional-logical-or-operator-) `||` or [conditional logical AND operator](boolean-logical-operators.md#conditional-logical-and-operator-) `&&`, respectively, can be evaluated for the operands of that type. For more information, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12143-user-defined-conditional-logical-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +If a type with the defined `true` and `false` operators [overloads](operator-overloading.md) the [logical OR operator](boolean-logical-operators.md#logical-or-operator-) `|` or the [logical AND operator](boolean-logical-operators.md#logical-and-operator-) `&` in a certain way, the [conditional logical OR operator](boolean-logical-operators.md#conditional-logical-or-operator-) `||` or [conditional logical AND operator](boolean-logical-operators.md#conditional-logical-and-operator-) `&&`, respectively, can be evaluated for the operands of that type. For more information, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12153-user-defined-conditional-logical-operators ) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## Example diff --git a/docs/csharp/language-reference/operators/type-testing-and-cast.md b/docs/csharp/language-reference/operators/type-testing-and-cast.md index 4df9e94f4f547..abdd3bb962328 100644 --- a/docs/csharp/language-reference/operators/type-testing-and-cast.md +++ b/docs/csharp/language-reference/operators/type-testing-and-cast.md @@ -145,9 +145,9 @@ A user-defined type can't overload the `()` operator, but can define custom type For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): -- [The `is` operator](~/_csharpstandard/standard/expressions.md#121212-the-is-operator) -- [The `as` operator](~/_csharpstandard/standard/expressions.md#121213-the-as-operator) -- [Cast expressions](~/_csharpstandard/standard/expressions.md#1297-cast-expressions) +- [The `is` operator](~/_csharpstandard/standard/expressions.md#121312-the-is-operator) +- [The `as` operator](~/_csharpstandard/standard/expressions.md#121313-the-as-operator) +- [Cast expressions](~/_csharpstandard/standard/expressions.md#1298-cast-expressions) - [The `typeof` operator](~/_csharpstandard/standard/expressions.md#12818-the-typeof-operator) ## See also diff --git a/docs/csharp/language-reference/statements/exception-handling-statements.md b/docs/csharp/language-reference/statements/exception-handling-statements.md index cdcfe5f89e328..5148bf610ec1c 100644 --- a/docs/csharp/language-reference/statements/exception-handling-statements.md +++ b/docs/csharp/language-reference/statements/exception-handling-statements.md @@ -42,7 +42,7 @@ Inside a [`catch` block](#the-try-catch-statement), you can use a `throw;` state > [!NOTE] > `throw;` preserves the original stack trace of the exception, which is stored in the property. Opposite to that, `throw e;` updates the property of `e`. -When an exception is thrown, the common language runtime (CLR) looks for the [`catch` block](#the-try-catch-statement) that can handle this exception. If the currently executed method doesn't contain such a `catch` block, the CLR looks at the method that called the current method, and so on up the call stack. If no `catch` block is found, the CLR terminates the executing thread. For more information, see the [How exceptions are handled](~/_csharpstandard/standard/exceptions.md#214-how-exceptions-are-handled) section of the [C# language specification](~/_csharpstandard/standard/README.md). +When an exception is thrown, the common language runtime (CLR) looks for the [`catch` block](#the-try-catch-statement) that can handle this exception. If the currently executed method doesn't contain such a `catch` block, the CLR looks at the method that called the current method, and so on up the call stack. If no `catch` block is found, the CLR terminates the executing thread. For more information, see the [How exceptions are handled](~/_csharpstandard/standard/exceptions.md#224-how-exceptions-are-handled) section of the [C# language specification](~/_csharpstandard/standard/README.md). ### The `throw` expression diff --git a/docs/csharp/language-reference/statements/fixed.md b/docs/csharp/language-reference/statements/fixed.md index 153c82bb11f55..569534311728b 100644 --- a/docs/csharp/language-reference/statements/fixed.md +++ b/docs/csharp/language-reference/statements/fixed.md @@ -49,8 +49,8 @@ You can also use the `fixed` keyword to declare a [fixed-size buffer](../unsafe- For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): -- [The fixed statement](~/_csharpstandard/standard/unsafe-code.md#237-the-fixed-statement) -- [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#234-fixed-and-moveable-variables) +- [The fixed statement](~/_csharpstandard/standard/unsafe-code.md#247-the-fixed-statement) +- [Fixed and moveable variables](~/_csharpstandard/standard/unsafe-code.md#244-fixed-and-moveable-variables) ## See also diff --git a/docs/csharp/linq/index.md b/docs/csharp/linq/index.md index 94a8bbf3bdb4c..d3ba24ae757db 100644 --- a/docs/csharp/linq/index.md +++ b/docs/csharp/linq/index.md @@ -22,7 +22,7 @@ You might need to add a [`using`](../language-reference/keywords/using-directive - Query expressions use many familiar C# language constructs, which make them easy to read. - The variables in a query expression are all strongly typed. - A query isn't executed until you iterate over the query variable, for example in a `foreach` statement. -- At compile time, query expressions are converted to standard query operator method calls according to the rules defined in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. In some cases, query syntax is more readable and concise. In others, method syntax is more readable. There's no semantic or performance difference between the two different forms. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1220-query-expressions) and [Standard query operators overview](standard-query-operators/index.md). +- At compile time, query expressions are converted to standard query operator method calls according to the rules defined in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. In some cases, query syntax is more readable and concise. In others, method syntax is more readable. There's no semantic or performance difference between the two different forms. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1221-query-expressions) and [Standard query operators overview](standard-query-operators/index.md). - Some query operations, such as or , have no equivalent query expression clause and must therefore be expressed as a method call. Method syntax can be combined with query syntax in various ways. - Query expressions can be compiled to expression trees or to delegates, depending on the type that the query is applied to. queries are compiled to delegates. and queries are compiled to expression trees. For more information, see [Expression trees](/dotnet/csharp/advanced-topics/expression-trees). diff --git a/docs/csharp/misc/cs0217.md b/docs/csharp/misc/cs0217.md index ec8fff9d8acec..e0bb38ad888cb 100644 --- a/docs/csharp/misc/cs0217.md +++ b/docs/csharp/misc/cs0217.md @@ -12,7 +12,7 @@ ms.assetid: ede61095-6e11-4f4a-8e7d-85e7a3f4fc3d In order to be applicable as a short circuit operator a user-defined logical operator ('operator') must have the same return type as the type of its 2 parameters. - If you define an operator for a user-defined type, and then try to use the operator as a short-circuit operator, the user-defined operator must have parameters and return values of the same type. For more information about short-circuit operators, see [`&&` operator](../language-reference/operators/boolean-logical-operators.md#conditional-logical-and-operator-) and [`||` operator](../language-reference/operators/boolean-logical-operators.md#conditional-logical-or-operator-). For more information about user-defined short-circuit, or conditional, operators, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12143-user-defined-conditional-logical-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). + If you define an operator for a user-defined type, and then try to use the operator as a short-circuit operator, the user-defined operator must have parameters and return values of the same type. For more information about short-circuit operators, see [`&&` operator](../language-reference/operators/boolean-logical-operators.md#conditional-logical-and-operator-) and [`||` operator](../language-reference/operators/boolean-logical-operators.md#conditional-logical-or-operator-). For more information about user-defined short-circuit, or conditional, operators, see the [User-defined conditional logical operators](~/_csharpstandard/standard/expressions.md#12153-user-defined-conditional-logical-operators ) section of the [C# language specification](~/_csharpstandard/standard/README.md). The following sample generates CS0217: diff --git a/docs/csharp/specification/toc.yml b/docs/csharp/specification/toc.yml index 8fe28a6c16ea9..a033831d1fa95 100644 --- a/docs/csharp/specification/toc.yml +++ b/docs/csharp/specification/toc.yml @@ -137,8 +137,6 @@ items: href: ../../../_csharplang/proposals/csharp-11.0/list-patterns.md - name: Expressions items: - - name: Ranges - href: ../../../_csharplang/proposals/csharp-8.0/ranges.md - name: Target-typed new expressions href: ../../../_csharplang/proposals/csharp-9.0/target-typed-new.md - name: Target-typed conditional expression diff --git a/docs/csharp/tutorials/ranges-indexes.md b/docs/csharp/tutorials/ranges-indexes.md index bbf4521a379d0..2327bc2ffb38e 100644 --- a/docs/csharp/tutorials/ranges-indexes.md +++ b/docs/csharp/tutorials/ranges-indexes.md @@ -83,7 +83,7 @@ Any type that provides an [indexer](../programming-guide/indexers/index.md) with > > In addition to the time complexity, this causes extra allocations and copies, impacting performance. In performance sensitive code, consider using `Span` or `Memory` as the sequence type, since the range operator does not allocate for them. -A type is **countable** if it has a property named `Length` or `Count` with an accessible getter and a return type of `int`. A countable type that doesn't explicitly support indices or ranges may provide an implicit support for them. For more information, see the [Implicit Index support](~/_csharplang/proposals/csharp-8.0/ranges.md#implicit-index-support) and [Implicit Range support](~/_csharplang/proposals/csharp-8.0/ranges.md#implicit-range-support) sections of the [feature proposal note](~/_csharplang/proposals/csharp-8.0/ranges.md). Ranges using implicit range support return the same sequence type as the source sequence. +A type is **countable** if it has a property named `Length` or `Count` with an accessible getter and a return type of `int`. A countable type that doesn't explicitly support indices or ranges may provide an implicit support for them. For more information, see the [Implicit Index support](~/_csharpstandard/standard/ranges.md#1842-implicit-index-support) and [Implicit Range support](~/_csharpstandard/standard/ranges.md#1843-implicit-range-support) sections of the [feature proposal note](~/_csharpstandard/standard/ranges.md). Ranges using implicit range support return the same sequence type as the source sequence. For example, the following .NET types support both indices and ranges: , , and . The supports indices but doesn't support ranges. diff --git a/docs/standard/attributes/writing-custom-attributes.md b/docs/standard/attributes/writing-custom-attributes.md index d0d1545b77e04..264110d9931ad 100644 --- a/docs/standard/attributes/writing-custom-attributes.md +++ b/docs/standard/attributes/writing-custom-attributes.md @@ -143,4 +143,4 @@ To design custom attributes, you don't need to learn many new concepts. If you'r - - - [Attributes](index.md) -- [Attribute parameter types](~/_csharpstandard/standard/attributes.md#2224-attribute-parameter-types) +- [Attribute parameter types](~/_csharpstandard/standard/attributes.md#2324-attribute-parameter-types)