[Mono-list] Re: Const weirdness, revisited...

Robert Jordan robertj@gmx.net
Tue, 22 Feb 2005 12:15:16 +0100


Miguel,

>>Well, if you just move the const int declaration into Main(), there's no 
>>warning or error any more.
>>
>>Anyway, as Robert Jordan said it's fixed in SVN, I guess I'll just 
>>apologize for the fuzz... :-)
> 
> 
> There is no `const' for local variables or parameters in C#.

of course there are:

static void Main() {
     const int i = 0;
     // mcs versions before 1.0.6 simply ignored the next assignment.
     // mcs HEAD (and probably 1.0.6 as well) throws the same
     // compiler error like csc.
     i = 15;
}

bye
Rob