Async-streams: await foreach
doesn't dispose result from ConfigureAwait
#32316
Labels
Milestone
await foreach
doesn't dispose result from ConfigureAwait
#32316
ConfiguredCancelableAsyncEnumerable<T>.Enumerator.DisposeAsync()
returnsConfiguredValueTaskAwaitable
, which doesn't match the interface.The problem is a side-effect of the recent decision to restrict pattern-based disposal to ref structs. Maybe we need to relax that restriction for async case.
Note: when we implement pattern-based disposal in
await foreach
(on any type), then we should also implement pattern-based disposal inawait using
(statements or declarations, also on any type).Relates to API https://github.com/dotnet/corefx/issues/33909
Umbrella for async-streams feature: #24037
The text was updated successfully, but these errors were encountered: