From a52c26102bff9a53e30c1bbff3d91c0e452c3bc7 Mon Sep 17 00:00:00 2001 From: neuecc Date: Wed, 20 May 2020 10:48:28 +0900 Subject: [PATCH] guard for ForEachAsync --- .../Plugins/UniTask/Runtime/Linq/ForEach.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs index e8dfb5f..60f246d 100644 --- a/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs +++ b/src/UniTask/Assets/Plugins/UniTask/Runtime/Linq/ForEach.cs @@ -22,6 +22,22 @@ namespace Cysharp.Threading.Tasks.Linq return Cysharp.Threading.Tasks.Linq.ForEach.ForEachAsync(source, action, cancellationToken); } + /// Obsolete(Error), Use Use ForEachAwaitAsync instead. + [Obsolete("Use ForEachAwaitAsync instead.", true)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + throw new NotSupportedException("Use ForEachAwaitAsync instead."); + } + + /// Obsolete(Error), Use Use ForEachAwaitAsync instead. + [Obsolete("Use ForEachAwaitAsync instead.", true)] + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public static UniTask ForEachAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) + { + throw new NotSupportedException("Use ForEachAwaitAsync instead."); + } + public static UniTask ForEachAwaitAsync(this IUniTaskAsyncEnumerable source, Func action, CancellationToken cancellationToken = default) { Error.ThrowArgumentNullException(source, nameof(source));