Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .openpublishing.redirection.csharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
"source_path_from_root": "/redirections/proposals/csharp-8.0/readonly-instance-members.md",
"redirect_url": "/dotnet/csharp/language-reference/language-specification/structs#16411-properties"
},
{
"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"
},
{
"source_path_from_root": "/redirections/proposals/csharp-8.0/async-streams.md",
"redirect_url": "/dotnet/csharp/language-reference/language-specification/statements.md#13953-await-foreach"
},
{
"source_path_from_root": "/redirections/proposals/csharp-9.0/nullable-reference-types-specification.md",
"redirect_url": "/dotnet/csharp/language-reference/language-specification/types.md#893-nullable-reference-types"
Expand Down
6 changes: 2 additions & 4 deletions docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
"csharp-8.0/nullable-reference-types-specification.md",
"csharp-8.0/nested-stackalloc.md",
"csharp-8.0/readonly-instance-members.md",
"csharp-8.0/null-coalescing-assignment.md",
"csharp-8.0/async-streams.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",
Expand Down Expand Up @@ -618,10 +620,8 @@
"_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/async-streams.md": "Async streams",
"_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-8.0/null-coalescing-assignment.md": "Null coalescing assignment",
"_csharplang/proposals/csharp-9.0/covariant-returns.md": "Covariant return types",
"_csharplang/proposals/csharp-9.0/extending-partial-methods.md": "Extending partial methods",
"_csharplang/proposals/csharp-9.0/extension-getenumerator.md": "Extension GetEnumerator support in foreach",
Expand Down Expand Up @@ -744,10 +744,8 @@
"_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/async-streams.md": "This feature specification describes async streams, which return streams of data asynchronously, typically as each element is produced or available.",
"_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-8.0/null-coalescing-assignment.md": "This feature specification describes the syntax to support null coalescing assignment expressions using the '??=' operator.",
"_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.",
"_csharplang/proposals/csharp-9.0/extension-getenumerator.md": "This feature specification describes the necessary pattern for an extension method to provide the GetEnumerator support in a foreach loop.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ The following example shows the behavior of an async event handler. In the examp

## Generalized async return types and ValueTask\<TResult\>

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 <xref:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute?displayProperty=nameWithType> attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the C# spec for the [Task type builder pattern](~/_csharpstandard/standard/classes.md#15152-task-type-builder-pattern).
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 <xref:System.Runtime.CompilerServices.AsyncMethodBuilderAttribute?displayProperty=nameWithType> attribute. You can learn more in the article on [Attributes read by the compiler](../language-reference/attributes/general.md#asyncmethodbuilder-attribute) or the C# spec for the [Task type builder pattern](~/_csharpstandard/standard/classes.md#15142-task-type-builder-pattern).

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

Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/programming-guide/concepts/iterators.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ On each successive iteration of the `foreach` loop (or the direct call to `IEnum

Iterators don't support the <xref:System.Collections.IEnumerator.Reset%2A?displayProperty=nameWithType> method. To reiterate from the start, you must obtain a new iterator. Calling <xref:System.Collections.IEnumerator.Reset%2A> on the iterator returned by an iterator method throws a <xref:System.NotSupportedException>.

For additional information, see the [C# Language Specification](~/_csharpstandard/standard/classes.md#1514-iterators).
For additional information, see the [C# Language Specification](~/_csharpstandard/standard/classes.md#1515-synchronous-and-asynchronous-iterators).

## Use of Iterators

Expand Down
4 changes: 0 additions & 4 deletions docs/csharp/specification/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@ items:
items:
- name: Ranges
href: ../../../_csharplang/proposals/csharp-8.0/ranges.md
- name: Null coalescing assignment
href: ../../../_csharplang/proposals/csharp-8.0/null-coalescing-assignment.md
- name: Target-typed new expressions
href: ../../../_csharplang/proposals/csharp-9.0/target-typed-new.md
- name: Target-typed conditional expression
Expand Down Expand Up @@ -187,8 +185,6 @@ items:
href: ../../../_csharplang/proposals/csharp-9.0/local-function-attributes.md
- name: Pattern based using and using declarations
href: ../../../_csharplang/proposals/csharp-8.0/using.md
- name: Async streams
href: ../../../_csharplang/proposals/csharp-8.0/async-streams.md
- name: Lock object semantics
href: ../../../_csharplang/proposals/csharp-13.0/lock-object.md
- name: Allow `ref` and `unsafe`
Expand Down