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