3 class ConditionalPromotions
5 public static int Test (bool condition
, short value)
7 return condition
? -1 : value;
10 public static int Main(string[] args
)
12 var r1
= args
.Length
> 0 ? 1 : (short)1;
13 var r2
= args
.Length
> 0 ? (short)1 : 1;
14 var r3
= args
.Length
> 0 ? 1 : (uint)1;
15 var r4
= args
.Length
> 0 ? (uint)1 : 1;
16 var r5
= args
.Length
> 0 ? 0 : (uint)1;
18 if (r1
.GetType () != typeof (int))
21 if (r2
.GetType () != typeof (int))
24 if (r3
.GetType () != typeof (uint))
27 if (r4
.GetType () != typeof (uint))
30 if (r5
.GetType () != typeof (uint))
34 byte a
= (byte)(true ? x
: 0);