[Mono-list] Const weirdness, revisited...
Tom
tom@verbreyt.be
Sat, 19 Feb 2005 15:05:06 +0100
--nextPart2813822.CA7aR85trD
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
[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).
Thanks,
Tom
=2D-=20
key: http://tmp.verbreyt.be/files/abwaerts.asc
--nextPart2813822.CA7aR85trD
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQBCF0eXLssppf5L8NYRAuxJAJwMyBWu46ZCkEpNR84OVOWR4chEUACgm494
aRpkyH+0MIgpUt6n1pjh8F8=
=QxoF
-----END PGP SIGNATURE-----
--nextPart2813822.CA7aR85trD--