Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AsyncObservable.DeferAsync infinite recursion #1979

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

idg10
Copy link
Collaborator

@idg10 idg10 commented Jul 25, 2023

Resolves #1976

The DeferAsync methods are meant to just call into the equivalent Defer methods. (I don't know the history behind why we have both, but I'm guessing that DeferAsync might be useful in cases where you want the compiler to infer the delegate type. With just Defer, it might be unclear whether you mean the one where the factory returns an observable, or the one where the factory returns a value task that produces an observable.)

This looks like a simple coding error: one of the DeferAsync overloads calls itself. (This is why we need #1900 - this would have been caught if this project had tests.)

The DeferAsync methods are meant to just call into the equivalent Defer methods. (I don't know why we have both, but I'm guessing that DeferAsync might be useful in cases where you want the compiler to infer the delegate type. With just Defer, it might be unclear whether you mean the one where the factory returns an observable, or the one where the factory returns a value task that produces an observable.)
@idg10 idg10 self-assigned this Jul 25, 2023
@idg10 idg10 merged commit dffafe1 into main Jul 27, 2023
@idg10 idg10 deleted the feature/1976-deferasync-bad-recursion branch July 27, 2023 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AsyncObservable.DeferAsync calls itselfs recursively.
2 participants