Take stars out of types where they make more sense.
[mono-project.git] / mcs / tests / test-631.cs
blob1069135514f7f139a17ea2643d97073268bdac4e
1 using System;
3 enum E : uint
5 Value = 24
8 class A
10 public static implicit operator sbyte (A mask)
12 return 1;
15 public static implicit operator byte (A mask)
17 return 2;
20 public static implicit operator short (A mask)
22 return 3;
25 public static implicit operator ushort (A mask)
27 return 4;
30 public static implicit operator int (A mask)
32 return 5;
35 public static implicit operator uint (A mask)
37 return 6;
40 public static implicit operator long (A mask)
42 return 7;
45 public static implicit operator ulong (A mask)
47 return 8;
51 class A2
53 public static implicit operator sbyte (A2 mask)
55 return 1;
58 public static implicit operator byte (A2 mask)
60 return 2;
63 public static implicit operator short (A2 mask)
65 return 3;
68 public static implicit operator uint (A2 mask)
70 return 6;
73 public static implicit operator long (A2 mask)
75 return 7;
78 public static implicit operator ulong (A2 mask)
80 return 8;
84 class A3
86 public static implicit operator sbyte (A3 mask)
88 return 1;
91 public static implicit operator uint (A3 mask)
93 return 6;
96 public static implicit operator long (A3 mask)
98 return 7;
101 public static implicit operator ulong (A3 mask)
103 return 8;
107 class A4
109 public static implicit operator uint (A4 mask)
111 return 6;
114 public static implicit operator long (A4 mask)
116 return 7;
119 public static implicit operator ulong (A4 mask)
121 return 8;
125 class A5
127 public static implicit operator uint (A5 mask)
129 return 6;
132 public static implicit operator int (A5 mask)
134 return 8;
138 class A6
140 public static implicit operator byte (A6 mask)
142 return 2;
146 class MyDecimal
148 public static implicit operator decimal (MyDecimal d)
150 return 42;
154 public class Constraint
156 public static int Main ()
158 A a = null;
159 A2 a2 = null;
160 A3 a3 = null;
161 A4 a4 = null;
162 A5 a5 = null;
163 A6 a6 = null;
165 if (-a != -5)
166 return 1;
167 if (-a2 != -3)
168 return 2;
169 if (-a3 != -1)
170 return 3;
171 if (-a4 != -7)
172 return 4;
173 if (-a5 != -8)
174 return 5;
175 if (-a6 != -2)
176 return 6;
178 if (~a != -6)
179 return 10;
180 if (~a2 != -4)
181 return 11;
182 if (~a3 != -2)
183 return 12;
184 if (~a4 != 4294967289)
185 return 13;
186 if (~a5 != -9)
187 return 14;
188 if (~a6 != -3)
189 return 15;
191 MyDecimal d = new MyDecimal ();
192 if (-d != -42)
193 return 20;
195 E e = E.Value;
196 if (~e != (E)4294967271)
197 return 21;
199 uint dp = 0;
200 dp = +dp;
202 Console.WriteLine ("OK");
203 return 0;