[mcs] C#7 throw expression
[mono.git] / mcs / tests / test-throw-expr-02.cs
1 using System;
2
3 class Program
4 {
5     public static int Main ()
6     {
7         Console.WriteLine (M (1));
8         try {
9             Console.WriteLine (M (null));
10         } catch (Exception) {
11             Console.WriteLine ("thrown");
12             return 0;
13         }
14
15         return 1;
16     }
17
18     static string M (object data)
19     {
20         return data?.ToString () ?? throw null;
21     }
22 }