Closed symbiogenesis closed 2 weeks ago
Consider the following examples:
await using var asyncDisposable = new AsyncDisposable(); Foo();
This should never throw CA2000, but I see it.
Consider, also:
var asyncDisposable = new AsyncDisposable(); await using (asyncDisposable.ConfigureAwait(false)) { Foo(); }
I would not expect this to result in a warning as long as asyncDisposable is not accessed again outside of the await using block.
asyncDisposable
await using
Note: In the event of ConfigureAwait() being applied, the disposable becomes type ConfiguredAsyncDisposable
ConfigureAwait()
ConfiguredAsyncDisposable
CAxxxx diagnostics are triggered by a package built from this repo: https://github.com/dotnet/roslyn-analyzers
Ah, thanks!
Consider the following examples:
This should never throw CA2000, but I see it.
Consider, also:
I would not expect this to result in a warning as long as
asyncDisposable
is not accessed again outside of theawait using
block.Note: In the event of
ConfigureAwait()
being applied, the disposable becomes typeConfiguredAsyncDisposable