Skip to content

Async-streams: await foreach doesn't dispose result from ConfigureAwait #32316

@jcouv

Description

@jcouv

ConfiguredCancelableAsyncEnumerable<T>.Enumerator.DisposeAsync() returns ConfiguredValueTaskAwaitable, 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 in await using (statements or declarations, also on any type).

Relates to API https://github.com/dotnet/corefx/issues/33909

Umbrella for async-streams feature: #24037

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions