linux-packaging-mono/mcs/tests/test-async-89.cs
Xamarin Public Jenkins (auto-signing) 804b15604f Imported Upstream version 4.6.0.182
Former-commit-id: 439c182e520038bf50777ca2fe684f216ae28552
2016-09-01 10:46:18 +00:00

51 lines
610 B
C#

using System;
using System.Threading.Tasks;
class X
{
public static void Main ()
{
new X ().Test ();
}
void Test ()
{
object v1 = null;
Action a = () =>
{
if (v1 == null)
{
object v2 = null;
Action a2 = () =>
{
Console.WriteLine (v2);
};
Action a3 = async () =>
{
// This scope needs to access to Scope which can do ldftn on instance method
{
Func<Task> a4 = async () =>
{
await Foo ();
};
}
await Task.Yield ();
};
a3 ();
}
};
a ();
}
async Task Foo ()
{
await Task.FromResult (1);
}
}