Skip to content

Commit 0778e87

Browse files
committed
Improved writing
1 parent ced29d3 commit 0778e87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/analyzers/PH_S034.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Problem
44

5-
C# infers a lambda expression to `async void`. This inference means that neither the asynchronous operation of it can be awaited nor a potential exception may be handled. Furthermore, any unhandled exception of this async lambda may lead to a crash of the application.
5+
C# may infer a lambda expression to `async void`, depending on the target type. This inference means that neither the asynchronous operation of it can be awaited nor a potential exception may be handled. Furthermore, any unhandled exception of this async lambda may lead to a crash of the application.
66

77
For example, see the code below. The interface `IWorkQueue` accepts a callback of type `Action`. The `DownloadFile` method provides an inline implementation with an async lambda. This lambda expression will be inferred to `async void`; thus, the completion of the asynchronous operation cannot be awaited by the implementation of `IWorkQueue`. Furthermore, an exception handler will be ineffective.
88

0 commit comments

Comments
 (0)