projects
/
mono.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
[build] Remove PEAPI from library profiles
[mono.git]
/
mcs
/
tests
/
test-async-42.cs
1
using System;
2
using System.Threading.Tasks;
3
4
class A
5
{
6
public Task<int> OpenAsync ()
7
{
8
return Task.FromResult (0);
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 Connection
21
{
22
get
23
{
24
return new A ();
25
}
26
}
27
28
async Task<int> Foo ()
29
{
30
{
31
await Test (
32
async () => {
33
await Connection.OpenAsync ();
34
});
35
}
36
37
return 0;
38
}
39
40
T Test<T> (Func<T> func)
41
{
42
return func ();
43
}
44
}
45