[Mono-list] Interface collisions

Gaurav Vaish gvaish@adobe.com
Tue, 10 Dec 2002 18:48:01 +0530


> Moreover, as I was playing with interfaces, I discovered the following
> case :
>
> ---
> $ 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 ()

    It should not give a Parse Error, but instead CS0106 - "The modifier
'public' is not valid for this item", which I get using "csc".

>
> error CS5001: Program Error.exe does not have an entry point defined
> Compilation failed: 1 error(s), 0 warnings

    That's Ok. You should compile it as a library and not as an executable.


Cheers,
The Little Master
http://mastergaurav.virtualave.net/iitk
________________________