Skip to content

Commit 1020d1c

Browse files
fix Standalone discard with Task sentence
1 parent a0cd50a commit 1020d1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/csharp/fundamentals/functional/discards.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ You can use a standalone discard to indicate any variable that you choose to ign
5757

5858
:::code language="csharp" source="snippets/discards/standalone-discard1.cs" ID="ArgNullCheck" :::
5959

60-
The following example uses a standalone discard to ignore the <xref:System.Threading.Tasks.Task> object returned by an asynchronous operation. Assigning the task has the effect of suppressing the exception that the operation throws as it is about to complete. It makes your intent clear: You want to discard the `Task`, and ignore any errors generated from that asynchronous operation.
60+
The following example uses a standalone discard to ignore the <xref:System.Threading.Tasks.Task> object returned by an asynchronous operation. Assigning the task has the effect of suppressing the compiler warning about unobserved exceptions. It makes your intent clear: You want to discard the `Task`, and ignore any errors generated from that asynchronous operation.
6161

6262
:::code language="csharp" source="snippets/discards/standalone-discard1.cs" ID="SnippetDiscardTask" :::
6363

0 commit comments

Comments
 (0)