[System.Data] Try to fix random DataViewTest.DefaultColumnNameAddListChangedTest...
[mono-project.git] / mcs / tests / test-decl-expr-01.cs
blob9078ff7caaa4814263d2c234eba8ba3ec388bb1a
1 // Compiler options: -langversion:experimental
2 using System;
4 class DeclarationExpression
6 public static int Main ()
8 Out (out int o);
9 if (o != 3)
10 return 1;
12 if (Out (out int o1)) {
13 if (o1 != 3)
14 return 2;
17 Out (out int o2 = 2);
18 if (o2 != 3)
19 return 3;
21 Out (out var o3);
22 if (o3 != 3)
23 return 4;
25 Ref (ref int r = 2);
26 if (r != 7)
27 return 5;
29 Ref (ref ((var r2 = 3)));
30 if (r2 != 8)
31 return 6;
33 // Out2 (str: "b", v: out var o5);
34 // if (o5 != 9)
35 // return 7;
37 Out3 (out var o6 = 9m);
38 if (o6.GetType () != typeof (decimal))
39 return 8;
41 Console.WriteLine ("ok");
42 return 0;
45 static bool Out (out int value)
47 value = 3;
48 return true;
51 static bool Out2 (out int v, string str)
53 v = 9;
54 return true;
57 static void Out3<T> (out T t)
59 t = default (T);
62 static void Ref (ref int arg)
64 arg += 5;