Open
Description
openedon Sep 17, 2020
Bug description
Similar to #108, the VSTHRD003 analyzer failed to recognize a deadlock-prone pattern of a JTF.Run delegate that simply returns the value of a Task
field.
Repro steps
See this PR (line 314) for the specific case the analyzer failed to catch the issue.
Roughly this:
Task task;
void Foo()
{
task = jtf.RunAsync(async () => { await Task.Yield(); }).Task;
jtf.Run(() => task); // violation should be found here.
}
Expected behavior
We should see a VSTHRD003 diagnostic as indicated above.
Actual behavior
No VSTHRD003 diagnostic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment