From 00aee771047454574ebfd42ea40122d65165697e Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Fri, 30 Nov 2018 17:24:19 -0500 Subject: [PATCH] Add AsyncIteratorStateMachineAttribute Exactly follows the design of AsyncStateMachineAttribute and IteratorStateMachineAttribute; the only thing different is the type name, "AsyncIterator" instead of "Async" and "Iterator". Commit migrated from https://github.com/dotnet/coreclr/commit/0f56562f58398b45e9b9ab4419e65cc0adffd6a5 --- .../src/System.Private.CoreLib.Shared.projitems | 1 + .../AsyncIteratorStateMachineAttribute.cs | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncIteratorStateMachineAttribute.cs diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 45d6e4823cf..270e2fdfce1 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -481,6 +481,7 @@ + diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncIteratorStateMachineAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncIteratorStateMachineAttribute.cs new file mode 100644 index 00000000000..c93156be4fa --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/AsyncIteratorStateMachineAttribute.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace System.Runtime.CompilerServices +{ + [AttributeUsage(AttributeTargets.Method, Inherited = false, AllowMultiple = false)] + public sealed class AsyncIteratorStateMachineAttribute : StateMachineAttribute + { + public AsyncIteratorStateMachineAttribute(Type stateMachineType) + : base(stateMachineType) + { + } + } +}