[Mono-list] Const weirdness, revisited...
Sat, 19 Feb 2005 15:05:06 +0100
[Saturday 19 February 2005 13:56] Mario Sopena
(Re: [Mono-list] Const weirdness, revisited...):
> > const int meh =3D 5;
> > meh =3D 10;
> I have tested with mono 1.0.5 and it compiles, but, at runtime, the
> line meh=3D10 doesn't make anything (you can test it yourself adding
> Console.WriteLine), the value of meh doesn't change.
Right. Why didn't I even think of testing it a tad more thoroughly...
> But, the Microsoft compiler argues by saying:
> "error CS0131: The left-hand side of an assignment must be a
> variable, property or indexer"
> on the line meh=3D10.
Exactly, I *did* check on that. I would expect the same behaviour from=20
Mono, and I think it's quite an obvious bug indeed (i.e. I cannot think=20
of any rational decision that might have been made about this).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
-----END PGP SIGNATURE-----