You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason I used ToEnumerable() extension to iterate IAsyncEnumerable synchronously.
And for sure I got the exception from this line of code.
Documentation tells us that this is not valid call for ValueTask: "The following operations should never be performed on a ValueTask<TResult> instance: ... Using .Result or .GetAwaiter().GetResult() when the operation hasn't yet completed, or using them multiple times".
I know, that I shouldn't use this extension, but I think this still should work correctly.
Also found some more usages of GetAwaiter().GetResult() from ValueTask in your code:
ThisDispose code in AsyncEnumerator, which can be a bigger problem than I found.
This extension method AsyncEnumerableAdapterExtensions.MoveNext leaved for backward compatibility.