Skip to content

Commit

Permalink
Fix AsyncObservable.DeferAsync infinite recursion (#1979)
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
idg10 authored Jul 27, 2023
1 parent 95d9ea9 commit dffafe1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion AsyncRx.NET/System.Reactive.Async/Linq/Operators/Defer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static IAsyncObservable<TSource> Defer<TSource>(Func<ValueTask<IAsyncObse
});
}

public static IAsyncObservable<TSource> DeferAsync<TSource>(Func<CancellationToken, ValueTask<IAsyncObservable<TSource>>> observableFactory) => DeferAsync(observableFactory);
public static IAsyncObservable<TSource> DeferAsync<TSource>(Func<CancellationToken, ValueTask<IAsyncObservable<TSource>>> observableFactory) => Defer(observableFactory);

public static IAsyncObservable<TSource> Defer<TSource>(Func<CancellationToken, ValueTask<IAsyncObservable<TSource>>> observableFactory)
{
Expand Down

0 comments on commit dffafe1

Please sign in to comment.