[Mono-list] const weirdness

Gonzalo Paniagua Javier gonzalo@gnome-db.org
Sun, 7 Apr 2002 23:19:43 +0200


* [ Miguel de Icaza <miguel@ximian.com>
* Sun, 07 Apr 2002 21:10:50 +0200 ]
> > However unless I am missing something this is not how it should fail:
> > 
> > 
> > (process:12689): ** WARNING **: unhandled exception
> > System.FormatException: "The specified format is invalid"

	In the current code for NumberToString (string, NumberFormatInfo, int)):
	if (!ParseFormat (format, out specifier, out precision))
		throw new FormatException (Locale.GetText ("The specified format '" + format + "' is invalid"));
	
	So it should also show the 'format' trying to be applied.

> It seems like the new integer formatter does not like the format we use
> for rendering data.  This is clearly a bug in the formatter.
> 
> Gonzalo, can you look at this?

	I added a 'Console.WriteLine' to report.cs:

		static public void Error (int code, Location l, string text)
		{
			string msg = String.Format (
				"{0}({1}) error CS{2:0000}: {3}", l.Name, l.Row, code, text);
			Console.WriteLine ("Error code is {0:0000}", code);
//				"{0}({1}) error CS{2}: {3}", l.Name, l.Row, code, text);
			
			RealError (msg);
			Check (code);
		}

	Then, when running mcs for the program given I get:

~ $ mcs fallo.cs
Error code is 0131
.\fallo.cs(7) error CS0131: Left hand of an assignment must be a variable, a property or an ind
exer
Error: Compilation failed
~ $

	It seems that it works :-?.

	Maybe the reporter of the error is using a previous version of
corlib.dll?