-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSE009: Do not report task awaited in lambda
- Loading branch information
1 parent
4a70f06
commit 330463b
Showing
7 changed files
with
97 additions
and
5 deletions.
There are no files selected for viewing
32 changes: 31 additions & 1 deletion
32
...tensions.Analyzers.Test/TaskVariableNotAwaited/TaskVariableNotAwaiteTestCases.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...SharpExtensions.Analyzers.Test/TaskVariableNotAwaited/TestCases/010_Awaited_In_Lambda.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace TestNamespace | ||
{ | ||
class SampleClass | ||
{ | ||
public async Task Test() | ||
{ | ||
var [|t2|] = CalculateAsync(); | ||
await Step(async () => | ||
{ | ||
await t2; | ||
}); | ||
|
||
} | ||
|
||
|
||
private static Task<int> CalculateAsync() => throw null; | ||
private static Task Step(Func<Task> func) => throw null; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/CSharpExtensions.Analyzers.Test/TaskVariableNotAwaited/sample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace TestNamespace | ||
{ | ||
class SampleClass | ||
{ | ||
public async Task Test() | ||
{ | ||
var t2 = CalculateAsync(); | ||
await Step(async () => | ||
{ | ||
await t2; | ||
}); | ||
|
||
} | ||
|
||
|
||
private static Task<int> CalculateAsync() => throw null; | ||
private static Task Step(Func<Task> func) => throw null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters