[Mono-list] A serious bug in C#???

Nikolai Smirnov Nikolai Smirnov" <nikolaismirnov@mail.ru
Fri, 25 Apr 2003 18:10:48 +0400


Dear colleagues!

I'll try this code:

class My
{
    public static void Main()
    {
         int i = 0;
         System.Console.WriteLine(i++ + i++ + i++);
                                  // 0 + 1 + 2
    }
}

mcs My.cs
momo My.exe

and I recieved "4" instead of "3" in C# for M$.NET or Java.

I've checked also:

int i = 0;
i = i++ + i++ + i++;

in gcc 3.2.2-5 RH9: "3".

Is it a bug?

Nikolai.