[Mono-list] const weirdness

Jonathan Stowe gellyfish@gellyfish.com
Sun, 7 Apr 2002 11:03:05 +0100 (BST)


On Sun, 7 Apr 2002, Jonathan Stowe wrote:

> 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.
>

OK, ignore this,  reading the stack trace more carefully I traced this
back to Mono.CSharp.Report::Error() and it's use of String.Format() -
what I am seeing here is a class library incompatibility : reverting the
format used to:

                "{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);

and everything works as expected.  Now to update the class library before
further testing :)

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