diff --git a/Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs b/Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs index 0d2ff7539c..1f3b47abce 100644 --- a/Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs +++ b/Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs @@ -108,7 +108,8 @@ public PeriodicallyScheduledWorkItem(CatchSchedulerPeriodic scheduler, TState st _catchScheduler = scheduler; _action = action; - Disposable.SetSingle(ref _cancel, scheduler._scheduler.SchedulePeriodic((@this: this, state), period, tuple => tuple.@this?.Tick(tuple.state) ?? default)); + // Note that avoiding closure allocation here would introduce infinite generic recursion over the TState argument + Disposable.SetSingle(ref _cancel, scheduler._scheduler.SchedulePeriodic(state, period, state1 => this.Tick(state1).state ?? default)); } public void Dispose()