From 1f776b5ef5b017b48d03bd4e0bacc06e51b68799 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 6 Apr 2023 10:24:42 -0400 Subject: [PATCH 1/6] Unpublish feature specs These two features are now incorporated into the draft V7 standard. Remove the feature speclets from docs. --- .openpublishing.redirection.csharp.json | 8 ++++++++ docfx.json | 26 ++++++++++++------------- docs/csharp/toc.yml | 4 ---- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index a36b854767723..90761b9692702 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -52,6 +52,14 @@ "source_path_from_root": "/redirections/proposals/csharp-7.3/blittable.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1425-type-parameter-constraints" }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2283-fixed-size-buffers-in-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#227-the-fixed-statement" + }, { "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" diff --git a/docfx.json b/docfx.json index 3fa1a210dca5d..87feb844c7461 100644 --- a/docfx.json +++ b/docfx.json @@ -85,6 +85,8 @@ "csharp-7.3/improved-overload-candidates.md", "csharp-7.3/ref-loops.md", "csharp-7.3/blittable.md", + "csharp-7.3/indexing-movable-fixed-fields.md", + "csharp-7.3/pattern-based-fixed.md", "csharp-8.0/alternative-interpolated-verbatim.md", "csharp-8.0/async-using.md", "csharp-8.0/constraints-in-overrides.md", @@ -145,7 +147,9 @@ "_csharplang/proposals/csharp-7.0/throw-expression.md", "_csharplang/proposals/csharp-7.1/target-typed-default.md", "_csharplang/proposals/csharp-7.2/readonly-struct.md", - "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md" + "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md", + "_csharplang/proposals/csharp-7.3/indexing-movable-fixed-fields.md", + "_csharplang/proposals/csharp-7.3/pattern-based-fixed.md" ] } }, @@ -660,8 +664,6 @@ "_csharplang/proposals/csharp-7.2/private-protected.md": "Private protected", "_csharplang/proposals/csharp-7.2/conditional-ref.md": "Conditional ref", "_csharplang/proposals/csharp-7.2/leading-separator.md": "Leading digit separator", - "_csharplang/proposals/csharp-7.3/indexing-movable-fixed-fields.md": "Indexing fixed fields without pinning regardless of context", - "_csharplang/proposals/csharp-7.3/pattern-based-fixed.md": "Pattern-based fixed statement", "_csharplang/proposals/csharp-7.3/ref-local-reassignment.md": "Ref local reassignment", "_csharplang/proposals/csharp-7.3/stackalloc-array-initializers.md": "Stackalloc array initializers", "_csharplang/proposals/csharp-7.3/expression-variables-in-initializers.md": "Expression variables in initializers", @@ -784,8 +786,6 @@ "_csharplang/proposals/csharp-7.2/private-protected.md": "This feature specification describes the 'private protected' access modifier.", "_csharplang/proposals/csharp-7.2/conditional-ref.md": "This feature specification describes the syntax enhancements for using 'ref' with '?:' expressions", "_csharplang/proposals/csharp-7.2/leading-separator.md": "This feature specification describes syntax enhancements to support a leading digit separator in numeric literals.", - "_csharplang/proposals/csharp-7.3/indexing-movable-fixed-fields.md": "This feature specification describes syntax enhancement to support indexing fixed fields without pinning the memory, regardless of context.", - "_csharplang/proposals/csharp-7.3/pattern-based-fixed.md": "This feature specification describes syntax enhancements to enable more types to be the target of a fixed statement.", "_csharplang/proposals/csharp-7.3/ref-local-reassignment.md": "This feature specification describes syntax enhancements that enable ref local variables to be assigned to refer to different storage after being initialized.", "_csharplang/proposals/csharp-7.3/stackalloc-array-initializers.md": "This feature specification describes the syntax that enables arrays to be declared using the 'stackalloc' keyword.", "_csharplang/proposals/csharp-7.3/expression-variables-in-initializers.md": "This feature specification enables declarations of 'out' variables in more locations.", @@ -864,14 +864,14 @@ }, "titleSuffix": { "_csharpstandard/standard/*.md": "C# language specification", - "_csharplang/proposals/csharp-7.0/*.md": "C# 7.0 draft specifications", - "_csharplang/proposals/csharp-7.1/*.md": "C# 7.1 draft specifications", - "_csharplang/proposals/csharp-7.2/*.md": "C# 7.2 draft specifications", - "_csharplang/proposals/csharp-7.3/*.md": "C# 7.3 draft specifications", - "_csharplang/proposals/csharp-8.0/*.md": "C# 8.0 draft specifications", - "_csharplang/proposals/csharp-9.0/*.md": "C# 9.0 draft specifications", - "_csharplang/proposals/csharp-10.0/*.md": "C# 10.0 draft specifications", - "_csharplang/proposals/csharp-11.0/*.md": "C# 11.0 draft specifications", + "_csharplang/proposals/csharp-7.0/*.md": "C# 7.0 draft feature specifications", + "_csharplang/proposals/csharp-7.1/*.md": "C# 7.1 draft feature specifications", + "_csharplang/proposals/csharp-7.2/*.md": "C# 7.2 draft feature specifications", + "_csharplang/proposals/csharp-7.3/*.md": "C# 7.3 draft feature specifications", + "_csharplang/proposals/csharp-8.0/*.md": "C# 8.0 draft feature specifications", + "_csharplang/proposals/csharp-9.0/*.md": "C# 9.0 draft feature specifications", + "_csharplang/proposals/csharp-10.0/*.md": "C# 10.0 draft feature specifications", + "_csharplang/proposals/csharp-11.0/*.md": "C# 11.0 draft feature specifications", "docs/framework/**/**.md": ".NET Framework", "docs/framework/data/adonet/**/**.md": "ADO.NET", "docs/framework/wcf/**/**.md": "WCF", diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index ccfeccb0d795c..d37a5fd2bdf9a 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -1320,10 +1320,6 @@ items: href: ../../_csharplang/proposals/csharp-7.2/conditional-ref.md - name: C# 7.3 features items: - - name: Indexing `fixed` fields should not require pinning regardless of the movable/unmovable context - href: ../../_csharplang/proposals/csharp-7.3/indexing-movable-fixed-fields.md - - name: Pattern-based `fixed` statement - href: ../../_csharplang/proposals/csharp-7.3/pattern-based-fixed.md - name: Ref local reassignment href: ../../_csharplang/proposals/csharp-7.3/ref-local-reassignment.md - name: Stackalloc array initializers From f66606645745d9334b1a34136602e5d17a3048e0 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 6 Apr 2023 10:47:17 -0400 Subject: [PATCH 2/6] build issues --- .openpublishing.redirection.csharp.json | 6 +++--- docfx.json | 5 +---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 90761b9692702..81f096679f2c4 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -53,13 +53,13 @@ "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes#1425-type-parameter-constraints" }, { - "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md.md", + "source_path_from_root": "/redirections/proposals/csharp-7.3/indexing-movable-fixed-fields.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#2283-fixed-size-buffers-in-expressions" }, { "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#227-the-fixed-statement" - }, + } { "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" @@ -1106,7 +1106,7 @@ }, { "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-7.3/index.md", - "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-7.3/blittable" + "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-7.3/ref-local-reassignment" }, { "source_path_from_root": "/docs/csharp/language-reference/proposals/csharp-8.0/index.md", diff --git a/docfx.json b/docfx.json index 87feb844c7461..4cdeade9ab05e 100644 --- a/docfx.json +++ b/docfx.json @@ -144,12 +144,9 @@ "exclude": [ "_csharplang/proposals/csharp-7.0/local-functions.md", "_csharplang/proposals/csharp-7.0/throw-expression.md", - "_csharplang/proposals/csharp-7.0/throw-expression.md", "_csharplang/proposals/csharp-7.1/target-typed-default.md", "_csharplang/proposals/csharp-7.2/readonly-struct.md", - "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md", - "_csharplang/proposals/csharp-7.3/indexing-movable-fixed-fields.md", - "_csharplang/proposals/csharp-7.3/pattern-based-fixed.md" + "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md" ] } }, From 2c5f0d1e9e3ade29610402c6d0715ee4b5c1c83c Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 6 Apr 2023 10:52:08 -0400 Subject: [PATCH 3/6] missed a comma --- .openpublishing.redirection.csharp.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 81f096679f2c4..07263f49a16e1 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -59,7 +59,7 @@ { "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#227-the-fixed-statement" - } + }, { "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" From 227b34cc5fe00e10985c0eb12b8bd743c577daa6 Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Thu, 6 Apr 2023 17:38:42 -0400 Subject: [PATCH 4/6] Yet another feature PR was merged Update per new feature PR merged in the standard. --- .openpublishing.redirection.csharp.json | 16 ++++++++++++++++ docfx.json | 24 ++++-------------------- docs/csharp/toc.yml | 8 -------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/.openpublishing.redirection.csharp.json b/.openpublishing.redirection.csharp.json index 07263f49a16e1..0a1b7c9a26cc4 100644 --- a/.openpublishing.redirection.csharp.json +++ b/.openpublishing.redirection.csharp.json @@ -16,6 +16,10 @@ "source_path_from_root": "/redirections/proposals/csharp-7.0/throw-expression.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions.md#1115-the-throw-expression-operator" }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.0/out-var.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions.md#1117-declaration-expressions" + }, { "source_path_from_root": "/redirections/proposals/csharp-7.1/async-main.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/basic-concepts#71-application-startup" @@ -24,6 +28,10 @@ "source_path_from_root": "/redirections/proposals/csharp-7.1/target-typed-default.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions#11719-default-value-expressions" }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.1/infer-tuple-names.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#8311-tuple-types" + }, { "source_path_from_root": "/redirections/proposals/csharp-7.2/private-protected.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/classes.md#1436-access-modifiers" @@ -60,6 +68,14 @@ "source_path_from_root": "/redirections/proposals/csharp-7.3/pattern-based-fixed.md", "redirect_url": "/dotnet/csharp/language-reference/language-specification/unsafe-code#227-the-fixed-statement" }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/expression-variables-in-initializers.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions.md#1117-declaration-expressions" + }, + { + "source_path_from_root": "/redirections/proposals/csharp-7.3/tuple-equality.md", + "redirect_url": "/dotnet/csharp/language-reference/language-specification/expressions.md#111211-tuple-equality-operators" + }, { "source_path_from_root": "/redirections/proposals/csharp-10.0/generic-attributes.md", "redirect_url": "/dotnet/csharp/language-reference/proposals/csharp-11.0/generic-attributes" diff --git a/docfx.json b/docfx.json index 4cdeade9ab05e..bece916a78454 100644 --- a/docfx.json +++ b/docfx.json @@ -71,8 +71,10 @@ "csharp-7.0/throw-expression.md", "csharp-7.0/tuples.md", "csharp-7.0/value-task.md", + "csharp-7.0/out-var.md", "csharp-7.1/async-main.md", "csharp-7.1/target-typed-default.md", + "csharp-7.1/infer-tuple-names.md", "csharp-7.2/leading-separator.md", "csharp-7.2/readonly-struct.md", "csharp-7.2/ref-struct-and-span.md", @@ -87,6 +89,8 @@ "csharp-7.3/blittable.md", "csharp-7.3/indexing-movable-fixed-fields.md", "csharp-7.3/pattern-based-fixed.md", + "csharp-7.3/expression-variables-in-initializers.md", + "csharp-7.3/tuple-equality.md", "csharp-8.0/alternative-interpolated-verbatim.md", "csharp-8.0/async-using.md", "csharp-8.0/constraints-in-overrides.md", @@ -648,23 +652,13 @@ "_csharpstandard/standard/documentation-comments.md": "Documentation comments", "_csharpstandard/standard/Bibliography.md": "Bibliography", "_csharplang/proposals/csharp-7.0/pattern-matching.md": "Pattern matching", - "_csharplang/proposals/csharp-7.0/out-var.md": "Out variable declarations", - "_csharplang/proposals/csharp-7.0/binary-literals.md": "Binary literals", - "_csharplang/proposals/csharp-7.0/digit-separators.md": "Digit separators", "_csharplang/proposals/csharp-7.0/task-types.md": "Async task types", - "_csharplang/proposals/csharp-7.1/target-typed-default.md": "Default expressions", - "_csharplang/proposals/csharp-7.1/infer-tuple-names.md": "Infer tuple member names", "_csharplang/proposals/csharp-7.1/generics-pattern-match.md": "Pattern matching with generics", "_csharplang/proposals/csharp-7.2/readonly-ref.md": "Readonly references", "_csharplang/proposals/csharp-7.2/span-safety.md": "Compile time safety for ref-like types", - "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md": "Non-trailing named arguments", - "_csharplang/proposals/csharp-7.2/private-protected.md": "Private protected", "_csharplang/proposals/csharp-7.2/conditional-ref.md": "Conditional ref", - "_csharplang/proposals/csharp-7.2/leading-separator.md": "Leading digit separator", "_csharplang/proposals/csharp-7.3/ref-local-reassignment.md": "Ref local reassignment", "_csharplang/proposals/csharp-7.3/stackalloc-array-initializers.md": "Stackalloc array initializers", - "_csharplang/proposals/csharp-7.3/expression-variables-in-initializers.md": "Expression variables in initializers", - "_csharplang/proposals/csharp-7.3/tuple-equality.md": "Tuple equality (==) and inequality (!=)", "_csharplang/proposals/csharp-8.0/nullable-reference-types.md": "Null reference types - proposal", "_csharplang/proposals/csharp-8.0/patterns.md": "Recursive pattern matching", "_csharplang/proposals/csharp-8.0/default-interface-methods.md": "Default interface methods", @@ -770,23 +764,13 @@ "_csharpstandard/standard/documentation-comments.md": "This appendix describes XML comments that are used to document your program.", "_csharpstandard/standard/Bibliography.md": "This appendix lists external standards referenced in this specification.", "_csharplang/proposals/csharp-7.0/pattern-matching.md": "This feature specification describes the pattern matching featues added in C# 7.0. Note that future releases built on this initial set of features.", - "_csharplang/proposals/csharp-7.0/out-var.md": "This feature specification describes syntax enhancements that enable declaring 'out' variables in the expression where they are used.", - "_csharplang/proposals/csharp-7.0/binary-literals.md": "This feature specification describes the syntax to declare binary literals for integral constants.", - "_csharplang/proposals/csharp-7.0/digit-separators.md": "This feature specification describes the syntax to allow separators between groups of digits in numeric literals.", "_csharplang/proposals/csharp-7.0/task-types.md": "This feature specification describes the syntax to support async return types that match a pattern, rather than restricting them to Task.", - "_csharplang/proposals/csharp-7.1/target-typed-default.md": "This feature specification describes the syntax to use the default keyword where the type of the expression can be inferred by the compiler.", - "_csharplang/proposals/csharp-7.1/infer-tuple-names.md": "This feature specification describes how the compiler interprets and infers the members names in a tuple.", "_csharplang/proposals/csharp-7.1/generics-pattern-match.md": "This feature specification describes syntax enhancements to enable pattern matching with generic types.", "_csharplang/proposals/csharp-7.2/readonly-ref.md": "This feature specification describes how to create readonly references to variables. This includes the 'readonly' modifier on variables, and the 'in' modifier on parameters and arguments.", "_csharplang/proposals/csharp-7.2/span-safety.md": "This feature specification describes the rules that govern 'ref struct' declarations and their use.", - "_csharplang/proposals/csharp-7.2/non-trailing-named-arguments.md": "This feature specification describes syntax enhancements that enable named arguments followed by positional arguments in a method call.", - "_csharplang/proposals/csharp-7.2/private-protected.md": "This feature specification describes the 'private protected' access modifier.", "_csharplang/proposals/csharp-7.2/conditional-ref.md": "This feature specification describes the syntax enhancements for using 'ref' with '?:' expressions", - "_csharplang/proposals/csharp-7.2/leading-separator.md": "This feature specification describes syntax enhancements to support a leading digit separator in numeric literals.", "_csharplang/proposals/csharp-7.3/ref-local-reassignment.md": "This feature specification describes syntax enhancements that enable ref local variables to be assigned to refer to different storage after being initialized.", "_csharplang/proposals/csharp-7.3/stackalloc-array-initializers.md": "This feature specification describes the syntax that enables arrays to be declared using the 'stackalloc' keyword.", - "_csharplang/proposals/csharp-7.3/expression-variables-in-initializers.md": "This feature specification enables declarations of 'out' variables in more locations.", - "_csharplang/proposals/csharp-7.3/tuple-equality.md": "This feature specification describes the rules governing tuple equality (==) and inequality (!=).", "_csharplang/proposals/csharp-8.0/nullable-reference-types.md": "This feature specification describes nullable reference types.", "_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.", diff --git a/docs/csharp/toc.yml b/docs/csharp/toc.yml index d37a5fd2bdf9a..7ca0f1752805a 100644 --- a/docs/csharp/toc.yml +++ b/docs/csharp/toc.yml @@ -1300,14 +1300,10 @@ items: items: - name: Pattern matching href: ../../_csharplang/proposals/csharp-7.0/pattern-matching.md - - name: Out variable declarations - href: ../../_csharplang/proposals/csharp-7.0/out-var.md - name: Async task types href: ../../_csharplang/proposals/csharp-7.0/task-types.md - name: C# 7.1 features items: - - name: Infer tuple names - href: ../../_csharplang/proposals/csharp-7.1/infer-tuple-names.md - name: Pattern matching with generics href: ../../_csharplang/proposals/csharp-7.1/generics-pattern-match.md - name: C# 7.2 features @@ -1324,10 +1320,6 @@ items: href: ../../_csharplang/proposals/csharp-7.3/ref-local-reassignment.md - name: Stackalloc array initializers href: ../../_csharplang/proposals/csharp-7.3/stackalloc-array-initializers.md - - name: Expression variables in initializers - href: ../../_csharplang/proposals/csharp-7.3/expression-variables-in-initializers.md - - name: Tuple equality (==) and inequality (!=) - href: ../../_csharplang/proposals/csharp-7.3/tuple-equality.md - name: C# 8.0 features items: - name: Nullable reference types - proposal From 5f73a4f609271886a0781f8ac2dce34c9c9ba34e Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 7 Apr 2023 10:14:34 -0400 Subject: [PATCH 5/6] address warnings from standard PR dotnet/csharpstandard#664 added a few new sections which rippled through the TOC. --- .../async-return-types.md | 2 +- .../language-reference/builtin-types/enum.md | 4 ++-- .../builtin-types/nullable-value-types.md | 2 +- .../operators/addition-operator.md | 2 +- .../operators/arithmetic-operators.md | 22 +++++++++---------- .../operators/assignment-operator.md | 2 +- .../language-reference/operators/await.md | 4 ++-- .../operators/bitwise-and-shift-operators.md | 8 +++---- .../operators/boolean-logical-operators.md | 10 ++++----- .../operators/comparison-operators.md | 2 +- .../operators/conditional-operator.md | 2 +- .../language-reference/operators/default.md | 2 +- .../operators/delegate-operator.md | 2 +- .../operators/equality-operators.md | 4 ++-- .../language-reference/operators/index.md | 2 +- .../csharp/language-reference/operators/is.md | 2 +- .../operators/lambda-expressions.md | 2 +- .../operators/lambda-operator.md | 2 +- .../operators/member-access-operators.md | 8 +++---- .../language-reference/operators/nameof.md | 2 +- .../operators/new-operator.md | 2 +- .../operators/null-coalescing-operator.md | 2 +- .../operators/operator-overloading.md | 2 +- .../operators/subtraction-operator.md | 4 ++-- .../operators/true-false-operators.md | 4 ++-- .../operators/type-testing-and-cast.md | 8 +++---- .../statements/checked-and-unchecked.md | 2 +- .../language-reference/tokens/interpolated.md | 2 +- docs/csharp/linq/index.md | 2 +- docs/csharp/misc/cs0217.md | 2 +- .../programming-guide/concepts/linq/index.md | 2 +- 31 files changed, 59 insertions(+), 59 deletions(-) diff --git a/docs/csharp/asynchronous-programming/async-return-types.md b/docs/csharp/asynchronous-programming/async-return-types.md index c278426f21197..11ad28d465ee6 100644 --- a/docs/csharp/asynchronous-programming/async-return-types.md +++ b/docs/csharp/asynchronous-programming/async-return-types.md @@ -75,7 +75,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 type returned from the `GetAwaiter` method must have the attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the feature spec for [Task like return types](~/_csharplang/proposals/csharp-7.0/task-types.md). -This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md#11882-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 additional memory allocations. +This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md##11982-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 additional memory allocations. .NET provides the structure as a lightweight implementation of a generalized task-returning value. To use the type, you must add the `System.Threading.Tasks.Extensions` NuGet package to your project. 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 725037f25d4d5..8040cd62ec3fb 100644 --- a/docs/csharp/language-reference/builtin-types/enum.md +++ b/docs/csharp/language-reference/builtin-types/enum.md @@ -74,8 +74,8 @@ For more information, see the following sections of the [C# language specificati - [Enums](~/_csharpstandard/standard/enums.md) - [Enum values and operations](~/_csharpstandard/standard/enums.md#186-enum-values-and-operations) -- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#11123-enumeration-logical-operators) -- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#11116-enumeration-comparison-operators) +- [Enumeration logical operators](~/_csharpstandard/standard/expressions.md#11133-enumeration-logical-operators) +- [Enumeration comparison operators](~/_csharpstandard/standard/expressions.md#11126-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/nullable-value-types.md b/docs/csharp/language-reference/builtin-types/nullable-value-types.md index 47d9ecf808442..014d8e36becef 100644 --- a/docs/csharp/language-reference/builtin-types/nullable-value-types.md +++ b/docs/csharp/language-reference/builtin-types/nullable-value-types.md @@ -115,7 +115,7 @@ Instead use the [!NOTE] > This method of computing the remainder is analogous to that 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#1194-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#11104-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. @@ -272,17 +272,17 @@ 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#11714-postfix-increment-and-decrement-operators) -- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1186-prefix-increment-and-decrement-operators) -- [Unary plus operator](~/_csharpstandard/standard/expressions.md#1182-unary-plus-operator) +- [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#11815-postfix-increment-and-decrement-operators) +- [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1196-prefix-increment-and-decrement-operators) +- [Unary plus operator](~/_csharpstandard/standard/expressions.md#1192-unary-plus-operator) - [Unary minus operator](~/_csharpstandard/standard/expressions.md#1183-unary-minus-operator) -- [Multiplication operator](~/_csharpstandard/standard/expressions.md#1192-multiplication-operator) -- [Division operator](~/_csharpstandard/standard/expressions.md#1193-division-operator) -- [Remainder operator](~/_csharpstandard/standard/expressions.md#1194-remainder-operator) -- [Addition operator](~/_csharpstandard/standard/expressions.md#1195-addition-operator) -- [Subtraction operator](~/_csharpstandard/standard/expressions.md#1196-subtraction-operator) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#11193-compound-assignment) -- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#11718-the-checked-and-unchecked-operators) +- [Multiplication operator](~/_csharpstandard/standard/expressions.md#11102-multiplication-operator) +- [Division operator](~/_csharpstandard/standard/expressions.md#11103-division-operator) +- [Remainder operator](~/_csharpstandard/standard/expressions.md#11104-remainder-operator) +- [Addition operator](~/_csharpstandard/standard/expressions.md#11105-addition-operator) +- [Subtraction operator](~/_csharpstandard/standard/expressions.md#11106-subtraction-operator) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#11213-compound-assignment) +- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#11819-the-checked-and-unchecked-operators) - [Numeric promotions](~/_csharpstandard/standard/expressions.md#1147-numeric-promotions) ## See also diff --git a/docs/csharp/language-reference/operators/assignment-operator.md b/docs/csharp/language-reference/operators/assignment-operator.md index 6cba0bb177df3..904a4df6d731b 100644 --- a/docs/csharp/language-reference/operators/assignment-operator.md +++ b/docs/csharp/language-reference/operators/assignment-operator.md @@ -72,7 +72,7 @@ A user-defined type can't explicitly overload a compound assignment operator. Ho ## C# language specification -For more information, see the [Assignment operators](~/_csharpstandard/standard/expressions.md#1119-assignment-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Assignment operators](~/_csharpstandard/standard/expressions.md#1121-assignment-operators) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about the ref assignment operator `= ref`, see the [feature proposal note](~/_csharplang/proposals/csharp-7.3/ref-local-reassignment.md). diff --git a/docs/csharp/language-reference/operators/await.md b/docs/csharp/language-reference/operators/await.md index d71543fd4f257..181d1e3d6795d 100644 --- a/docs/csharp/language-reference/operators/await.md +++ b/docs/csharp/language-reference/operators/await.md @@ -23,7 +23,7 @@ The preceding example uses the [async `Main` method](../../fundamentals/program- You can use the `await` operator only in a method, [lambda expression](lambda-expressions.md), or [anonymous method](delegate-operator.md) that is modified by the [async](../keywords/async.md) keyword. Within an async method, you can't use the `await` operator in the body of a synchronous function, inside the block of a [lock statement](../statements/lock.md), and in an [unsafe](../keywords/unsafe.md) context. -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#11882-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#11982-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. For more information about exception handling, see the [Exceptions in async methods](../keywords/try-catch.md#exceptions-in-async-methods) section of the [try-catch statement](../keywords/try-catch.md) article. @@ -39,7 +39,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#1188-await-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Await expressions](~/_csharpstandard/standard/expressions.md#1198-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 055cbb09a5973..1be7362dfd297 100644 --- a/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md +++ b/docs/csharp/language-reference/operators/bitwise-and-shift-operators.md @@ -196,10 +196,10 @@ 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#1185-bitwise-complement-operator) -- [Shift operators](~/_csharpstandard/standard/expressions.md#1110-shift-operators) -- [Logical operators](~/_csharpstandard/standard/expressions.md#1112-logical-operators) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#11193-compound-assignment) +- [Bitwise complement operator](~/_csharpstandard/standard/expressions.md#1195-bitwise-complement-operator) +- [Shift operators](~/_csharpstandard/standard/expressions.md#1111-shift-operators) +- [Logical operators](~/_csharpstandard/standard/expressions.md#1113-logical-operators) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#11213-compound-assignment) - [Numeric promotions](~/_csharpstandard/standard/expressions.md#1147-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 62f52abf99abe..b295759d2d5cf 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. A user-defined type can't explicitly overload a compound assignment operator. -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#11133-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#11143-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#1184-logical-negation-operator) -- [Logical operators](~/_csharpstandard/standard/expressions.md#1112-logical-operators) -- [Conditional logical operators](~/_csharpstandard/standard/expressions.md#1113-conditional-logical-operators) -- [Compound assignment](~/_csharpstandard/standard/expressions.md#11193-compound-assignment) +- [Logical negation operator](~/_csharpstandard/standard/expressions.md#1194-logical-negation-operator) +- [Logical operators](~/_csharpstandard/standard/expressions.md#1113-logical-operators) +- [Conditional logical operators](~/_csharpstandard/standard/expressions.md#1114-conditional-logical-operators) +- [Compound assignment](~/_csharpstandard/standard/expressions.md#11213-compound-assignment) ## See also diff --git a/docs/csharp/language-reference/operators/comparison-operators.md b/docs/csharp/language-reference/operators/comparison-operators.md index 66d0a42d1e6d8..e114a757875ac 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#1111-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#1112-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 79adae63bb400..b8768cdbdc8a8 100644 --- a/docs/csharp/language-reference/operators/conditional-operator.md +++ b/docs/csharp/language-reference/operators/conditional-operator.md @@ -81,7 +81,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#1116-conditional-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Conditional operator](~/_csharpstandard/standard/expressions.md#1118-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/default.md b/docs/csharp/language-reference/operators/default.md index cd09a2b262a67..61ced983c70d5 100644 --- a/docs/csharp/language-reference/operators/default.md +++ b/docs/csharp/language-reference/operators/default.md @@ -37,7 +37,7 @@ The following example shows the usage of the `default` literal: ## C# language specification -For more information, see the [Default value expressions](~/_csharpstandard/standard/expressions.md#11719-default-value-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Default value expressions](~/_csharpstandard/standard/expressions.md#11820-default-value-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). ## See also diff --git a/docs/csharp/language-reference/operators/delegate-operator.md b/docs/csharp/language-reference/operators/delegate-operator.md index 308d94be6bc39..60121c3e29592 100644 --- a/docs/csharp/language-reference/operators/delegate-operator.md +++ b/docs/csharp/language-reference/operators/delegate-operator.md @@ -59,7 +59,7 @@ Action a = () => StaticFunction(); ## C# language specification -For more information, see the [Anonymous function expressions](~/_csharpstandard/standard/expressions.md#1117-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#1119-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 4130dcc0d82b1..9ec0412c3dded 100644 --- a/docs/csharp/language-reference/operators/equality-operators.md +++ b/docs/csharp/language-reference/operators/equality-operators.md @@ -69,7 +69,7 @@ Two [delegate](../../programming-guide/delegates/index.md) operands of the same [!code-csharp-interactive[delegate equality](snippets/shared/EqualityOperators.cs#DelegateEquality)] -For more information, see the [Delegate equality operators](~/_csharpstandard/standard/expressions.md#11119-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#11129-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: @@ -95,7 +95,7 @@ public virtual bool Equals(T? other); ## C# language specification -For more information, see the [Relational and type-testing operators](~/_csharpstandard/standard/expressions.md#1111-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#1112-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/index.md b/docs/csharp/language-reference/operators/index.md index 1da7d607e5621..1e373c5b9845f 100644 --- a/docs/csharp/language-reference/operators/index.md +++ b/docs/csharp/language-reference/operators/index.md @@ -96,7 +96,7 @@ When operators have the same precedence, associativity of the operators determin - *Right-associative* operators are evaluated in order from right to left. The assignment operators, the null-coalescing operators, lambdas, and the [conditional operator `?:`](conditional-operator.md) are right-associative. For example, `x = y = z` is evaluated as `x = (y = z)`. > [!IMPORTANT] -> In an expression of the form `P?.A0?.A1`, if `P` is `null`, neither `A0` nor `A1` are evaluated. Similarly, in an expression of the form `P?.A0.A1`, because `A0` isn't evaluated when `P` is null, neither is `A0.A1`. See the [C# language specification](~/_csharpstandard/standard/expressions.md#1177-null-conditional-member-access) for more details. +> In an expression of the form `P?.A0?.A1`, if `P` is `null`, neither `A0` nor `A1` are evaluated. Similarly, in an expression of the form `P?.A0.A1`, because `A0` isn't evaluated when `P` is null, neither is `A0.A1`. See the [C# language specification](~/_csharpstandard/standard/expressions.md#1188-null-conditional-member-access) for more details. Use parentheses to change the order of evaluation imposed by operator associativity: diff --git a/docs/csharp/language-reference/operators/is.md b/docs/csharp/language-reference/operators/is.md index 121b587e6eaf1..e6bcf422c9213 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#111111-the-is-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md) and the following C# language proposals: +For more information, see [The is operator](~/_csharpstandard/standard/expressions.md#111212-the-is-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md) and the following C# language proposals: - [Pattern matching](~/_csharplang/proposals/csharp-7.0/pattern-matching.md) - [Pattern matching with generics](~/_csharplang/proposals/csharp-7.1/generics-pattern-match.md) diff --git a/docs/csharp/language-reference/operators/lambda-expressions.md b/docs/csharp/language-reference/operators/lambda-expressions.md index cfdcb5384a2c2..06c1b35ab08a8 100644 --- a/docs/csharp/language-reference/operators/lambda-expressions.md +++ b/docs/csharp/language-reference/operators/lambda-expressions.md @@ -305,7 +305,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#1117-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#1119-anonymous-function-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about features added in C# 9.0 and later, 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 f1302ba99bf1b..efe6952c52f0b 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#1117-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#1119-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 b8a3a80bd4a4b..b9cb256e8af67 100644 --- a/docs/csharp/language-reference/operators/member-access-operators.md +++ b/docs/csharp/language-reference/operators/member-access-operators.md @@ -236,10 +236,10 @@ The `.`, `()`, `^`, and `..` operators can't be overloaded. The `[]` operator is For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): -- [Member access](~/_csharpstandard/standard/expressions.md#1176-member-access) -- [Element access](~/_csharpstandard/standard/expressions.md#11710-element-access) -- [Null-conditional member access](~/_csharpstandard/standard/expressions.md#1177-null-conditional-member-access) -- [Invocation expressions](~/_csharpstandard/standard/expressions.md#1178-invocation-expressions) +- [Member access](~/_csharpstandard/standard/expressions.md#1187-member-access) +- [Element access](~/_csharpstandard/standard/expressions.md#11811-element-access) +- [Null-conditional member access](~/_csharpstandard/standard/expressions.md#1188-null-conditional-member-access) +- [Invocation expressions](~/_csharpstandard/standard/expressions.md#1189-invocation-expressions) For more information about indices and ranges, see the [feature proposal note](~/_csharplang/proposals/csharp-8.0/ranges.md). diff --git a/docs/csharp/language-reference/operators/nameof.md b/docs/csharp/language-reference/operators/nameof.md index 3115146db5077..04baac577b894 100644 --- a/docs/csharp/language-reference/operators/nameof.md +++ b/docs/csharp/language-reference/operators/nameof.md @@ -32,7 +32,7 @@ When the operand is a [verbatim identifier](../tokens/verbatim.md), the `@` char ## C# language specification -For more information, see the [Nameof expressions](~/_csharpstandard/standard/expressions.md#11720-nameof-expressions) 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. +For more information, see the [Nameof expressions](~/_csharpstandard/standard/expressions.md#11821-nameof-expressions) 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. ## See also diff --git a/docs/csharp/language-reference/operators/new-operator.md b/docs/csharp/language-reference/operators/new-operator.md index 1777ef06619c9..abe38f8c4f340 100644 --- a/docs/csharp/language-reference/operators/new-operator.md +++ b/docs/csharp/language-reference/operators/new-operator.md @@ -60,7 +60,7 @@ A user-defined type can't overload the `new` operator. ## C# language specification -For more information, see [The new operator](~/_csharpstandard/standard/expressions.md#11715-the-new-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see [The new operator](~/_csharpstandard/standard/expressions.md#11816-the-new-operator) section of the [C# language specification](~/_csharpstandard/standard/README.md). For more information about a target-typed `new` expression, see the [feature proposal note](~/_csharplang/proposals/csharp-9.0/target-typed-new.md). diff --git a/docs/csharp/language-reference/operators/null-coalescing-operator.md b/docs/csharp/language-reference/operators/null-coalescing-operator.md index ecad0e5ef9ec4..365481f326f48 100644 --- a/docs/csharp/language-reference/operators/null-coalescing-operator.md +++ b/docs/csharp/language-reference/operators/null-coalescing-operator.md @@ -83,7 +83,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#1114-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#1115-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 d9bf884689282..996df7c83b550 100644 --- a/docs/csharp/language-reference/operators/operator-overloading.md +++ b/docs/csharp/language-reference/operators/operator-overloading.md @@ -42,7 +42,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#11133-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#11143-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 that can be performed by a cast expression. For more information, see [User-defined conversion operators](user-defined-conversion-operators.md).| |[`+=`](arithmetic-operators.md#compound-assignment), [`-=`](arithmetic-operators.md#compound-assignment), [`*=`](arithmetic-operators.md#compound-assignment), [`/=`](arithmetic-operators.md#compound-assignment), [`%=`](arithmetic-operators.md#compound-assignment), [`&=`](boolean-logical-operators.md#compound-assignment), [|=](boolean-logical-operators.md#compound-assignment), [`^=`](boolean-logical-operators.md#compound-assignment), [`<<=`](bitwise-and-shift-operators.md#compound-assignment), [`>>=`](bitwise-and-shift-operators.md#compound-assignment), [`>>>=`](bitwise-and-shift-operators.md#compound-assignment)|Overload the corresponding binary operator. For example, when you overload the binary `+` operator, `+=` is implicitly overloaded.| diff --git a/docs/csharp/language-reference/operators/subtraction-operator.md b/docs/csharp/language-reference/operators/subtraction-operator.md index be4392a0ea381..737ebb2859711 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-csharp-interactive[delegate removal with no effect](snippets/shared/SubtractionOperator.cs#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#11119-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#11129-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#1183-unary-minus-operator) and [Subtraction operator](~/_csharpstandard/standard/expressions.md#1196-subtraction-operator) sections of the [C# language specification](~/_csharpstandard/standard/README.md). +For more information, see the [Unary minus operator](~/_csharpstandard/standard/expressions.md#1193-unary-minus-operator) and [Subtraction operator](~/_csharpstandard/standard/expressions.md#11106-subtraction-operator) sections of the [C# language specification](~/_csharpstandard/standard/README.md). ## 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 d3af18a2a5cab..b2095a07685cd 100644 --- a/docs/csharp/language-reference/operators/true-false-operators.md +++ b/docs/csharp/language-reference/operators/true-false-operators.md @@ -15,11 +15,11 @@ The `true` operator returns the [bool](../builtin-types/bool.md) value `true` to ## 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#1122-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#1124-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#11133-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#11143-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 5c7f1cbea4fd3..2a8b2bc9e691b 100644 --- a/docs/csharp/language-reference/operators/type-testing-and-cast.md +++ b/docs/csharp/language-reference/operators/type-testing-and-cast.md @@ -145,10 +145,10 @@ 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#111111-the-is-operator) -- [The as operator](~/_csharpstandard/standard/expressions.md#111112-the-as-operator) -- [Cast expressions](~/_csharpstandard/standard/expressions.md#1187-cast-expressions) -- [The typeof operator](~/_csharpstandard/standard/expressions.md#11716-the-typeof-operator) +- [The is operator](~/_csharpstandard/standard/expressions.md#111212-the-is-operator) +- [The as operator](~/_csharpstandard/standard/expressions.md#111213-the-as-operator) +- [Cast expressions](~/_csharpstandard/standard/expressions.md#1197-cast-expressions) +- [The typeof operator](~/_csharpstandard/standard/expressions.md#11817-the-typeof-operator) ## See also diff --git a/docs/csharp/language-reference/statements/checked-and-unchecked.md b/docs/csharp/language-reference/statements/checked-and-unchecked.md index 401812821663c..518c13a63425a 100644 --- a/docs/csharp/language-reference/statements/checked-and-unchecked.md +++ b/docs/csharp/language-reference/statements/checked-and-unchecked.md @@ -55,7 +55,7 @@ Constant expressions are evaluated by default in a checked context and a compile For more information, see the following sections of the [C# language specification](~/_csharpstandard/standard/README.md): - [The checked and unchecked statements](~/_csharpstandard/standard/statements.md#1212-the-checked-and-unchecked-statements) -- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#11718-the-checked-and-unchecked-operators) +- [The checked and unchecked operators](~/_csharpstandard/standard/expressions.md#11819-the-checked-and-unchecked-operators) - [User defined checked and unchecked operators - C# 11](~/_csharplang/proposals/csharp-11.0/checked-user-defined-operators.md) ## See also diff --git a/docs/csharp/language-reference/tokens/interpolated.md b/docs/csharp/language-reference/tokens/interpolated.md index 176df98a20568..f57e4cb8f0616 100644 --- a/docs/csharp/language-reference/tokens/interpolated.md +++ b/docs/csharp/language-reference/tokens/interpolated.md @@ -109,7 +109,7 @@ Beginning with C# 10, when an interpolated string is used, the compiler checks i ## C# language specification -For more information, see the [Interpolated strings](~/_csharpstandard/standard/expressions.md#1173-interpolated-string-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md), the [C# 11 - Raw string literals](~/_csharplang/proposals/csharp-11.0/raw-string-literal.md) feature specification and the [C# 11 - Newlines in string interpolations](~/_csharplang/proposals/csharp-11.0/new-line-in-interpolation.md) feature specification. +For more information, see the [Interpolated strings](~/_csharpstandard/standard/expressions.md#1183-interpolated-string-expressions) section of the [C# language specification](~/_csharpstandard/standard/README.md), the [C# 11 - Raw string literals](~/_csharplang/proposals/csharp-11.0/raw-string-literal.md) feature specification and the [C# 11 - Newlines in string interpolations](~/_csharplang/proposals/csharp-11.0/new-line-in-interpolation.md) feature specification. ## See also diff --git a/docs/csharp/linq/index.md b/docs/csharp/linq/index.md index 7998cd2b55ff2..690f8935a5a31 100644 --- a/docs/csharp/linq/index.md +++ b/docs/csharp/linq/index.md @@ -25,7 +25,7 @@ The following example shows the complete query operation. The complete operation - A query is not executed until you iterate over the query variable, for example, in a `foreach` statement. For more information, see [Introduction to LINQ queries](../programming-guide/concepts/linq/introduction-to-linq-queries.md). -- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1118-query-expressions) and [Standard query operators overview](../programming-guide/concepts/linq/standard-query-operators-overview.md). +- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1120-query-expressions) and [Standard query operators overview](../programming-guide/concepts/linq/standard-query-operators-overview.md). - As a rule when you write LINQ queries, we recommend that you use query syntax whenever possible and method syntax whenever necessary. There is no semantic or performance difference between the two different forms. Query expressions are often more readable than equivalent expressions written in method syntax. diff --git a/docs/csharp/misc/cs0217.md b/docs/csharp/misc/cs0217.md index b56361de83bd3..5dd0453eb570d 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#11133-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#11143-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/programming-guide/concepts/linq/index.md b/docs/csharp/programming-guide/concepts/linq/index.md index 1144451c99418..850d3f0ac259b 100644 --- a/docs/csharp/programming-guide/concepts/linq/index.md +++ b/docs/csharp/programming-guide/concepts/linq/index.md @@ -27,7 +27,7 @@ The following illustration from Visual Studio shows a partially-completed LINQ q - Query expressions are easy to grasp because they use many familiar C# language constructs. - The variables in a query expression are all strongly typed, although in many cases you do not have to provide the type explicitly because the compiler can infer it. For more information, see [Type relationships in LINQ query operations](type-relationships-in-linq-query-operations.md). - A query is not executed until you iterate over the query variable, for example, in a `foreach` statement. For more information, see [Introduction to LINQ queries](introduction-to-linq-queries.md). -- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1118-query-expressions) and [Standard query operators overview](standard-query-operators-overview.md). +- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1119-query-expressions) and [Standard query operators overview](standard-query-operators-overview.md). - As a rule when you write LINQ queries, we recommend that you use query syntax whenever possible and method syntax whenever necessary. There is no semantic or performance difference between the two different forms. Query expressions are often more readable than equivalent expressions written in method syntax. - 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. For more information, see [Query syntax and method syntax in LINQ](query-syntax-and-method-syntax-in-linq.md). - 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). From 828bf8e6569a37f74cb1ab5a9acd35a0f870c8be Mon Sep 17 00:00:00 2001 From: Bill Wagner Date: Fri, 7 Apr 2023 10:23:21 -0400 Subject: [PATCH 6/6] warnings, take 2 --- docs/csharp/asynchronous-programming/async-return-types.md | 2 +- .../csharp/language-reference/operators/arithmetic-operators.md | 2 +- docs/csharp/programming-guide/concepts/linq/index.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/csharp/asynchronous-programming/async-return-types.md b/docs/csharp/asynchronous-programming/async-return-types.md index 11ad28d465ee6..a705977ca76db 100644 --- a/docs/csharp/asynchronous-programming/async-return-types.md +++ b/docs/csharp/asynchronous-programming/async-return-types.md @@ -75,7 +75,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 type returned from the `GetAwaiter` method must have the attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the feature spec for [Task like return types](~/_csharplang/proposals/csharp-7.0/task-types.md). -This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md##11982-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 additional memory allocations. +This feature is the complement to [awaitable expressions](~/_csharpstandard/standard/expressions.md#11982-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 additional memory allocations. .NET provides the structure as a lightweight implementation of a generalized task-returning value. To use the type, you must add the `System.Threading.Tasks.Extensions` NuGet package to your project. The following example uses the structure to retrieve the value of two dice rolls. diff --git a/docs/csharp/language-reference/operators/arithmetic-operators.md b/docs/csharp/language-reference/operators/arithmetic-operators.md index 83c6894850992..97ae02754e68e 100644 --- a/docs/csharp/language-reference/operators/arithmetic-operators.md +++ b/docs/csharp/language-reference/operators/arithmetic-operators.md @@ -275,7 +275,7 @@ For more information, see the following sections of the [C# language specificati - [Postfix increment and decrement operators](~/_csharpstandard/standard/expressions.md#11815-postfix-increment-and-decrement-operators) - [Prefix increment and decrement operators](~/_csharpstandard/standard/expressions.md#1196-prefix-increment-and-decrement-operators) - [Unary plus operator](~/_csharpstandard/standard/expressions.md#1192-unary-plus-operator) -- [Unary minus operator](~/_csharpstandard/standard/expressions.md#1183-unary-minus-operator) +- [Unary minus operator](~/_csharpstandard/standard/expressions.md#1193-unary-minus-operator) - [Multiplication operator](~/_csharpstandard/standard/expressions.md#11102-multiplication-operator) - [Division operator](~/_csharpstandard/standard/expressions.md#11103-division-operator) - [Remainder operator](~/_csharpstandard/standard/expressions.md#11104-remainder-operator) diff --git a/docs/csharp/programming-guide/concepts/linq/index.md b/docs/csharp/programming-guide/concepts/linq/index.md index 850d3f0ac259b..6b5e8372c1cc6 100644 --- a/docs/csharp/programming-guide/concepts/linq/index.md +++ b/docs/csharp/programming-guide/concepts/linq/index.md @@ -27,7 +27,7 @@ The following illustration from Visual Studio shows a partially-completed LINQ q - Query expressions are easy to grasp because they use many familiar C# language constructs. - The variables in a query expression are all strongly typed, although in many cases you do not have to provide the type explicitly because the compiler can infer it. For more information, see [Type relationships in LINQ query operations](type-relationships-in-linq-query-operations.md). - A query is not executed until you iterate over the query variable, for example, in a `foreach` statement. For more information, see [Introduction to LINQ queries](introduction-to-linq-queries.md). -- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1119-query-expressions) and [Standard query operators overview](standard-query-operators-overview.md). +- At compile time, query expressions are converted to Standard Query Operator method calls according to the rules set forth in the C# specification. Any query that can be expressed by using query syntax can also be expressed by using method syntax. However, in most cases query syntax is more readable and concise. For more information, see [C# language specification](~/_csharpstandard/standard/expressions.md#1120-query-expressions) and [Standard query operators overview](standard-query-operators-overview.md). - As a rule when you write LINQ queries, we recommend that you use query syntax whenever possible and method syntax whenever necessary. There is no semantic or performance difference between the two different forms. Query expressions are often more readable than equivalent expressions written in method syntax. - 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. For more information, see [Query syntax and method syntax in LINQ](query-syntax-and-method-syntax-in-linq.md). - 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).