Description
I noticed an ergonomic issue with the event streams added in #17349 (which are fantastic, by the way!) that seemed worth noting: When ConfigureAwait(bool) is called on IEventStream<> to control capturing context during disposal, it causes compile error CS0121 due to ambiguity between TaskAsyncEnumerableExtensions.ConfigureAwait(IAsyncDisposable, bool) and TaskAsyncEnumerableExtensions.ConfigureAwait<T>(IAsyncEnumerable<T>, bool).
This isn't a showstopper, since a cast to either type can be added to resolve the ambiguity. However, this seems less than ideal as it clutters the code for a common operation, and steepens the learning code as developers need to understand how to resolve the error initially and determine which cast to make.
Perhaps it would make sense to provide a .ConfigureAwait<T>(IEventStream<T>, bool) extension method which forwards to TaskAsyncEnumerableExtensions.ConfigureAwait<T>(IAsyncEnumerable<T>, bool) to avoid the ambiguity?
Have you considered any alternatives or workarounds?
No response
Description
I noticed an ergonomic issue with the event streams added in #17349 (which are fantastic, by the way!) that seemed worth noting: When
ConfigureAwait(bool)is called onIEventStream<>to control capturing context during disposal, it causes compile errorCS0121due to ambiguity betweenTaskAsyncEnumerableExtensions.ConfigureAwait(IAsyncDisposable, bool)andTaskAsyncEnumerableExtensions.ConfigureAwait<T>(IAsyncEnumerable<T>, bool).This isn't a showstopper, since a cast to either type can be added to resolve the ambiguity. However, this seems less than ideal as it clutters the code for a common operation, and steepens the learning code as developers need to understand how to resolve the error initially and determine which cast to make.
Perhaps it would make sense to provide a
.ConfigureAwait<T>(IEventStream<T>, bool)extension method which forwards toTaskAsyncEnumerableExtensions.ConfigureAwait<T>(IAsyncEnumerable<T>, bool)to avoid the ambiguity?Have you considered any alternatives or workarounds?
No response