Skip to content

Commit 21e9128

Browse files
glihmglihmadamsitnik
authored
Add note about ValueTask and ValueTask<TResult> default constructors (dotnet#4397) (dotnet#4576)
* Add note about ValueTask and ValueTask<TResult> default constructors (dotnet#4397) * Apply suggestions from code review Co-authored-by: glihm <[email protected]> Co-authored-by: Adam Sitnik <[email protected]>
1 parent 2f1cd50 commit 21e9128

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

xml/System.Threading.Tasks/ValueTask.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ Using a `ValueTask` instead of a <xref:System.Threading.Tasks.Task> introduces s
6464
6565
> [!NOTE]
6666
> The use of the `ValueTask` type is supported starting with C# 7.0 and is not supported by any version of Visual Basic.
67+
68+
> [!NOTE]
69+
> An instance created with the parameterless constructor or by the `default(ValueTask)` syntax (a zero-initialized structure) represents a synchronously, successfully completed operation.
70+
6771
]]></format>
6872
</remarks>
6973
</Docs>

xml/System.Threading.Tasks/ValueTask`1.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ As such, the default choice for any asynchronous method should be to return a <x
7777
7878
> [!NOTE]
7979
> The use of the <xref:System.Threading.Tasks.ValueTask%601> type is supported starting with C# 7.0, and is not supported by any version of Visual Basic.
80+
81+
> [!NOTE]
82+
> An instance created with the parameterless constructor or by the `default(ValueTask<TResult>)` syntax (a zero-initialized structure) represents a synchronously, successfully completed operation with a result of `default(TResult)`.
83+
8084
]]></format>
8185
</remarks>
8286
</Docs>

0 commit comments

Comments
 (0)