// Miguel de Icaza (miguel@ximian.com)
// Marek Safar (marek.safar@seznam.cz)
//
-// (C) 2002, 2003 Ximian, Inc.
-//
-
+// Copyright 2002, 2003 Ximian, Inc.
+// Copyright 2003-2008, Novell, Inc.
+//
using System;
namespace Mono.CSharp {
bool bool_res;
if (lt == TypeManager.bool_type && lt == rt) {
- bool lv = ((BoolConstant) left ).Value;
- bool rv = ((BoolConstant) right).Value;
+ bool lv = (bool) left.GetValue ();
+ bool rv = (bool) right.GetValue ();
switch (oper) {
case Binary.Operator.BitwiseAnd:
case Binary.Operator.LogicalAnd:
case Binary.Operator.LeftShift:
IntConstant ic = right.ConvertImplicitly (TypeManager.int32_type) as IntConstant;
if (ic == null){
- Binary.Error_OperatorCannotBeApplied (loc, "<<", lt, rt);
+ Binary.Error_OperatorCannotBeApplied (left, right, oper, loc);
return null;
}
if (left.Type == TypeManager.int32_type)
return new IntConstant (((IntConstant)left).Value << lshift_val, left.Location);
- Binary.Error_OperatorCannotBeApplied (loc, "<<", lt, rt);
+ Binary.Error_OperatorCannotBeApplied (left, right, oper, loc);
break;
//
case Binary.Operator.RightShift:
IntConstant sic = right.ConvertImplicitly (TypeManager.int32_type) as IntConstant;
if (sic == null){
- Binary.Error_OperatorCannotBeApplied (loc, ">>", lt, rt);
+ Binary.Error_OperatorCannotBeApplied (left, right, oper, loc); ;
return null;
}
int rshift_val = sic.Value;
if (left.Type == TypeManager.int32_type)
return new IntConstant (((IntConstant)left).Value >> rshift_val, left.Location);
- Binary.Error_OperatorCannotBeApplied (loc, ">>", lt, rt);
+ Binary.Error_OperatorCannotBeApplied (left, right, oper, loc);
break;
case Binary.Operator.Equality: