[Mono-list] Interface collisions

Miguel de Icaza miguel@ximian.com
10 Dec 2002 13:30:34 -0500


Hello,

> Which is fine except that in the book the output of csc looks even 
> smarter. The error used is CS 0111 and states that it is not possible to 
> implement these interface at the same time. It would be nice if mcs 
> could do the same...

Please file a `wish list' bug in bugzilla.ximian.com

Note that its possible to implement the interface methods if you use
explicit interface implementation.

> $ cat Error.cs
> using System;
> 
> interface I { public void F(); }
> 
> public class TestClass : I {}
> ---
> 
> (the visibility is explicitily set to "public")
> 
> which produce the following message
> 
> ---
> $ mcs Error.cs
> syntax error, expecting BOOL BYTE CHAR DECIMAL DOUBLE EVENT FLOAT INT 
> LONG NEW OBJECT SBYTE SHORT STRING UINT ULONG USHORT VOID CLOSE_BRACE 
> OPEN_BRACKET IDENTIFIER
> Error.cs (3,17), Token: PUBLIC   : Parsing error
> Mono.CSharp.yyParser.yyException: irrecoverable syntax error
> in <0x006fa> 00 Mono.CSharp.CSharpParser:yyparse 
> (Mono.CSharp.yyParser.yyInput)
> in <0x0006f> 00 Mono.CSharp.CSharpParser:parse ()
> 
> error CS5001: Program Error.exe does not have an entry point defined
> Compilation failed: 1 error(s), 0 warnings
> ---
> 
> Is there anything wrong there ? Should I fill a bug (haven't found 
> anything relatedin bugzilla) ?

Well, the error reporting should certainly improve, but using the
"public" modifier is not allowed by the grammar, hence the parse error.

Miguel