* expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
Because of the way we parse things, we should try to see if a
UIntConstant can fit in an integer.
svn path=/trunk/mcs/; revision=4379
+2002-05-07 Miguel de Icaza <miguel@ximian.com>
+
+ * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
+ Because of the way we parse things, we should try to see if a
+ UIntConstant can fit in an integer.
+
2002-05-07 Ravi Pratap <ravi@ximian.com>
* ecore.cs (GetConversionOperators): Do not pick up op_True operators
if (expr is IntConstant)
e = new IntConstant (-((IntConstant) expr).Value);
- else if (expr is UIntConstant)
- e = new LongConstant (-((UIntConstant) expr).Value);
+ else if (expr is UIntConstant){
+ uint value = ((UIntConstant) expr).Value;
+
+ if (value < 2147483649)
+ return new IntConstant (-(int)value);
+ else
+ e = new LongConstant (value);
+ }
else if (expr is LongConstant)
e = new LongConstant (-((LongConstant) expr).Value);
else if (expr is FloatConstant)