[Mono-list] const weirdness

Jonathan Stowe gellyfish@gellyfish.com
Sun, 7 Apr 2002 09:31:41 +0100 (BST)


On Sun, 7 Apr 2002, Daniel Carrera wrote:

> Well, you declared myInt to be a constant and then you tried to change the
> value.  Thus I'd expect that it should fail.
>

Precisely, I was testing that it did indeed fail as it should.

> However, I would expect mcs to fail more elegantly that it did.  Maybe
> something like:
>
> "Error: line 8, cannot assign value to constant"

csc will fail with "The left-hand side of an assignment must be a
variable, property or indexer".

My point was more that it probably shouldn't fail with an unhandled
exception and also, unless the stack trace is bogus, it appears to be
failing for the wrong reason.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |