X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fcfold.cs;h=47c76af3ed8226bbd8f83f21404ba0cb4aecb1d1;hb=109bb0350beed07567ae9d5e9aa26e0d37e05342;hp=e46b792cdb7c0a8146ff327175b54554102eaf9b;hpb=eb26c3ec23b874867c234ce170c12acc11fb6d35;p=mono.git diff --git a/mcs/mcs/cfold.cs b/mcs/mcs/cfold.cs index e46b792cdb7..47c76af3ed8 100644 --- a/mcs/mcs/cfold.cs +++ b/mcs/mcs/cfold.cs @@ -5,9 +5,9 @@ // 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 { @@ -80,7 +80,7 @@ namespace Mono.CSharp { return BinaryFold (ec, oper, ((EmptyConstantCast)left).child, right, loc); if (left is SideEffectConstant) { - result = BinaryFold (ec, oper, ((SideEffectConstant) left).left, right, loc); + result = BinaryFold (ec, oper, ((SideEffectConstant) left).value, right, loc); if (result == null) return null; return new SideEffectConstant (result, left, loc); @@ -90,7 +90,7 @@ namespace Mono.CSharp { return BinaryFold (ec, oper, left, ((EmptyConstantCast)right).child, loc); if (right is SideEffectConstant) { - result = BinaryFold (ec, oper, left, ((SideEffectConstant) right).left, loc); + result = BinaryFold (ec, oper, left, ((SideEffectConstant) right).value, loc); if (result == null) return null; return new SideEffectConstant (result, right, loc); @@ -101,8 +101,8 @@ 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: @@ -782,7 +782,7 @@ namespace Mono.CSharp { 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; } @@ -798,7 +798,7 @@ namespace Mono.CSharp { 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; // @@ -807,7 +807,7 @@ namespace Mono.CSharp { 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; @@ -822,7 +822,7 @@ namespace Mono.CSharp { 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: