瀏覽代碼

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 年之前
父節點
當前提交
dffafe1101
共有 1 個文件被更改,包括 1 次插入1 次删除
  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)
         {