2 using System.Reflection;
3 using System.Threading.Tasks;
4 using System.Runtime.CompilerServices;
9 public static async Task<int> AsyncMethod ()
17 var m = typeof (C).GetMethod ("AsyncMethod");
18 var attr = m.GetCustomAttribute<AsyncStateMachineAttribute> ();
22 if (attr.StateMachineType == null)
25 Func<Task<int>> a = async () => await AsyncMethod ();
27 var c = typeof (C).GetMethods (BindingFlags.NonPublic | BindingFlags.Static).Where (l =>
28 l.IsDefined (typeof (AsyncStateMachineAttribute))).Count ();