projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Merge pull request #5675 from mono/glib-debug-symbols
[mono.git]
/
mcs
/
tests
/
test-async-43.cs
1
using System;
2
using System.Threading.Tasks;
3
4
class A
5
{
6
public Task<int> GetValue (int b)
7
{
8
return Task.FromResult (b);
9
}
10
}
11
12
class C
13
{
14
public static int Main ()
15
{
16
var c = new C ();
17
return c.Foo ().Result;
18
}
19
20
public A Instance {
21
get {
22
return new A ();
23
}
24
}
25
26
async Task<int> Foo ()
27
{
28
int value = 1;
29
30
{
31
int b = 3;
32
await Test (value,
33
async () => {
34
await Instance.GetValue (b);
35
});
36
}
37
38
return 0;
39
}
40
41
T Test<T> (int arg, Func<T> func)
42
{
43
return func ();
44
}
45
}
46