Imported Upstream version 3.8.0

Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
Jo Shields
2014-09-04 09:07:35 +01:00
parent a575963da9
commit fe777c5c82
1062 changed files with 12460 additions and 5983 deletions

View File

@ -14,6 +14,15 @@ namespace N.M
return 0;
}
public static async Task NestedAsyncAnonymousMethod ()
{
Action a = async delegate {
await Task.Yield();
};
await Task.Yield();
}
public static int Main ()
{
var m = typeof (C).GetMethod ("AsyncMethod");
@ -32,6 +41,28 @@ namespace N.M
if (c != 1)
return 3;
m = typeof (C).GetMethod ("NestedAsyncAnonymousMethod");
attr = m.GetCustomAttribute<AsyncStateMachineAttribute> ();
if (attr == null)
return 10;
if (attr.StateMachineType == null)
return 11;
var n = typeof (C).GetNestedTypes (BindingFlags.NonPublic).Single (l => l.Name.Contains ("NestedAsyncAnonymousMethod"));
if (n == null)
return 12;
m = n.GetMethods (BindingFlags.NonPublic | BindingFlags.Static).Single (l => l.Name.Contains ("m__"));
attr = m.GetCustomAttribute<AsyncStateMachineAttribute> ();
if (attr == null)
return 13;
if (attr.StateMachineType == null)
return 14;
return 0;
}
}