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 e8dfb5f5..60f246dd 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 @@ public static UniTask ForEachAsync(this IUniTaskAsyncEnumerableObsolete(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));