Browse Source

Fix AsyncObservable.DeferAsync infinite recursion (#1979)

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.)
Ian Griffiths 2 năm trước cách đây
mục cha
commit
dffafe1101
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      AsyncRx.NET/System.Reactive.Async/Linq/Operators/Defer.cs

+ 1 - 1
AsyncRx.NET/System.Reactive.Async/Linq/Operators/Defer.cs

@@ -43,7 +43,7 @@ namespace System.Reactive.Linq
             });
         }
 
-        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)
         {