Merge pull request #394 from directhex/master
[mono.git] / mcs / tests / test-async-22.cs
1 using System;
2 using System.Threading.Tasks;
3
4 // contextual async during parsing
5
6 class A
7 {
8         async Task<int> async ()
9         {
10                 int async;
11                 throw new NotImplementedException ();
12         }
13
14         async Task async (int async)
15         {
16                 throw new NotImplementedException ();
17         }
18         
19         async void CastTest ()
20         {
21                 var res = (int) await async ();
22                 var res2 = (Int32) await async ();
23         }
24
25         public static int Main ()
26         {
27                 return 0;
28         }
29 }
30
31 class B
32 {
33         class async
34         {
35                 async (async arg)
36                 {
37                 }
38         }
39 }
40
41 class C
42 {
43         static void Test (bool async)
44         {
45                 var a = async ? Prop : 2;
46         }
47
48         static int Prop {
49                 get {
50                         return 3;
51                 }
52         }
53 }
54
55 class async
56 {
57         async (async arg)
58         {
59                 int await = 0;
60         }
61 }
62
63 class await
64 {
65         await (await arg)
66         {
67         }
68 }
69
70 [async]
71 class asyncAttribute: Attribute
72 {
73         delegate async async (async async);
74 }