a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
47 lines
506 B
C#
47 lines
506 B
C#
using System;
|
|
using System.Threading.Tasks;
|
|
|
|
class A
|
|
{
|
|
public Task<int> GetValue (int b)
|
|
{
|
|
return Task.FromResult (b);
|
|
}
|
|
}
|
|
|
|
class C
|
|
{
|
|
public static int Main ()
|
|
{
|
|
var c = new C ();
|
|
return c.Foo ().Result;
|
|
}
|
|
|
|
public A Instance {
|
|
get {
|
|
return new A ();
|
|
}
|
|
}
|
|
|
|
async Task<int> Foo ()
|
|
{
|
|
int value = 1;
|
|
|
|
{
|
|
int b = 3;
|
|
await Test (value,
|
|
async () => {
|
|
await Instance.GetValue (b);
|
|
});
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
T Test<T> (int arg, Func<T> func)
|
|
{
|
|
return func ();
|
|
}
|
|
}
|
|
|