You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.182
Former-commit-id: 439c182e520038bf50777ca2fe684f216ae28552
This commit is contained in:
parent
c911219690
commit
804b15604f
51
mcs/tests/test-async-89.cs
Normal file
51
mcs/tests/test-async-89.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user