update
[mcs.git] / tests / gtest-409.cs
blob7605b604d51cb1e4d8f88887c876e3d89e9e8a03
1 using System;
3 //
4 // Parser conditional expression tests
5 //
7 public class ConditionalParsing
9 class T
11 public T (string path, bool mode)
12 : this (path, mode, (mode == true ? 1 : 2), 1, int.MaxValue)
16 public T (string s, bool m, int i, int i2, int i3)
21 class Const
23 const int c = true ? 1 : 2;
26 struct S
30 void Test_1 (bool a)
32 int? b = a ? 3 : 4;
35 void Test_2 ()
37 string mp = "";
38 int a = 1;
39 int _provider = mp.Length == a ? _provider = 4 : 5;
42 T? Test_3<T> (Func<T, T, T> result, T t) where T : struct
44 return new T? (result (t, t));
47 void Test_4 (bool x, bool y)
49 int s = x ? (y ? 2 : 4) : (y ? 5 : 7);
52 void Test_5 (bool a, IDisposable fs)
54 using (a ? fs : null) {
55 Console.WriteLine ("");
59 void Test_6 (bool a)
61 char[] escaped_text_chars =
62 a != false ?
63 new char [] {'&', '<', '>', '\r', '\n'} :
64 new char [] {'&', '<', '>'};
67 void Test_7 (object o)
69 object a = (S?[]) o;
72 public static void Main ()