[Mono-list] Bug related to operator += and instance fields

Ravindra Kumar rkumar@novell.com
Sun, 22 Feb 2004 22:33:52 -0700


Hello,
Bug is filed at http://bugzilla.ximian.com/show_bug.cgi?id=54742 

Thanks
-Ravindra


>>> "Rodolfo Campero" <rodolfocampero@hotmail.com> 2/22/2004 2:51:34 AM
>>>
Hello everybody,

I've found a bug, but I'm not sure about how to report it (I mean I
can't 
find a suitable subject and other info):

The following source code compiles but its execution results in
incorrect 
behavior:

<code>
using System;
namespace Test {
  public class A {
    public static void Main () {
      A a = new A ();
      a.Test ();
    }

    public void Test ()
    {
      A a = new A ();
      // the following is the problematic line
      _intValue += a.Value + a.Value / 2;
      Console.WriteLine (_intValue);
    }

    private int _intValue;
    public readonly int Value = 100;
  }
}
</code>

The actual result is 50 but I think it should be 150.

I need someone to give me instructions about the affected product 
(Mono/Compilers or Mono/Runtime or ...) and a suitable subject if
possible, 
or to tell me that this is not a bug and I'm plain wrong :-)

If someone can file the bug report for me it's ok too.

TIA,

Rodolfo

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus 

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com 
http://lists.ximian.com/mailman/listinfo/mono-list