[mcs] Update logic when checking for tuple element names when overriding inherited...
[mono.git] / mcs / tests / test-async-65.cs
1 using System;
2 using System.Threading.Tasks;
3
4 class C
5 {
6         static int counter;
7
8         public static async Task TestRethrow (Exception e)
9         {
10                 try {
11                         throw e;
12                 } catch (ApplicationException) {
13                         Console.WriteLine ("x1a");
14                         counter = 1;
15                         await Task.Delay (1);
16                         Console.WriteLine ("x2a");
17                         counter = 3;
18                         throw;
19                 } catch {
20                         counter = 9;
21                         await Task.Delay (1);
22                         Console.WriteLine ("ga");
23                         throw;
24                 }
25         }
26
27         public static int Main ()
28         {
29                 var ex = new ApplicationException ();
30                 try {
31                         TestRethrow (ex).Wait ();
32                 } catch (AggregateException e) {
33                         if (e.InnerException != ex)
34                                 return 1;
35                 }
36
37                 if (counter != 3)
38                         return 2;
39
40                 var ex2 = new NotSupportedException ();
41                 try {
42                         TestRethrow (ex2).Wait ();
43                 } catch (AggregateException e) {
44                         if (e.InnerException != ex2)
45                                 return 3;
46                 }
47
48                 if (counter != 9)
49                         return 4;
50
51                 Console.WriteLine ("ok");
52                 return 0;
53         }
54 }