2 using System.Threading.Tasks;
6 static bool Verify (Func<bool> f)
11 static async Task<int> TestCapturedException (Exception e)
16 } catch (Exception ex) when (Verify (() => ex.Message == "foo")) {
18 Console.WriteLine (ex);
20 } catch (Exception ex) when (Verify (() => ex.Message != null)) {
22 Console.WriteLine (ex);
29 public static int Main()
31 if (TestCapturedException (null).Result != 3)
34 var ex = new ApplicationException ();
35 if (TestCapturedException (ex).Result != 2)