Take stars out of types where they make more sense.
[mono-project.git] / mcs / tests / test-async-93.cs
blob249de2aed77c328f8c84bc512d3bc03f0c23520c
1 using System;
2 using System.Threading.Tasks;
4 public class Test
6 public static int Main()
8 var t = new Test ();
9 t.Entry().Wait();
10 if (t.caughtCounter != 1)
11 return 1;
13 return 0;
16 int caughtCounter;
18 async Task Entry()
20 for (int i = 0; i < 5; ++i) {
21 try {
22 var result = Func(i);
23 Console.WriteLine($"{i} result {result}");
24 } catch (Exception e) {
25 await Nothing();
26 Console.WriteLine($"{i} caught");
27 ++caughtCounter;
32 bool Func(int i)
34 if (i == 0) {
35 throw new Exception();
36 } else {
37 return true;
41 async Task Nothing()