[Mono-list] ADV: Thinking in C# Release Candidate Ebook Available

Paolo Molaro lupus@ximian.com
Wed, 20 Nov 2002 14:42:31 +0100


On 11/19/02 Miguel de Icaza wrote:
> > I just did a for i in *.cs; do mcs $i; done to compile the samples with
> > mcs, recompiling some by hand (those that required a /r:System.Data or a
> > specific dll). I found one bug in mcs (related to shift operators on the
> > char type) and a couple of missing features in our libraries (index by
> > name in the regular expression groups, isolated storage, ...).
> 
> >>From the C# spec, I believe that the sample program:
> 
> 	char c = (char) 1;
> 
> 	c <<= 1;
> 
> Should not compile according to the C# spec, and that the Microsoft
> compiler is more lax than it should be.  

Ok, I had a look at the spec and this indeed looks like a bug in csc.
The issue is that people are going to depend on the csc bugs in a way or
the other, sigh. What if we emit a warning in this case? Something like:

	This is incorrect C# code, but csc allows it, please fix.

Or we may have a command line switch (/cscbugs) that emits a warning in
such cases, but it allows compilation to succeed. There should be only a
few such bugs, so it would not uglify the mcs code that much.

lupus

-- 
-----------------------------------------------------------------
lupus@debian.org                                     debian/rules
lupus@ximian.com                             Monkeys do it better