[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]Enum declaration; Conflicts and Blame for Interoperability P

From: Rhys Weatherley
Subject: Re: [DotGNU]Enum declaration; Conflicts and Blame for Interoperability Problems
Date: Tue, 7 Jan 2003 20:35:28 +1000
User-agent: KMail/1.4.3

On Tuesday 07 January 2003 08:18 pm, Marcus wrote:

> The problem occurred as part of my testing to assess how well Qt#
> interoperates with Mono and Pnet. I discovered that when classes containing
> enums were compiled into libraries by the Mono C# Compiler (mcs), Pnet's C#
> Compiler (cscc) did not handle the enum's member properly. Specifically,
> with a declaration like this

I've added some code to the CVS version of cscc that will recognise both forms 
of enum definition.

> The problem now is that the Mono developers claim that their
> declaration is correct and in compliance with the spec, whereas the Pnet
> are equally adamant that Mono is wrong and that Mono should fix their C#
> compiler.

*ahem* Not to start a spec interpretation war or anything (as I've already 
worked around this):

Section 7.5.4 of ECMA-335, page 34:

    CLS Rule 9: Literal static fields (see clause 7.6.1) of an enum shall
    have the type of the enum itself.

(Clause 7.6.1 basically says that literal static fields don't have real 
storage at runtime but are instead expanded by the compiler.  That is not in 
dispute here - we are both doing that correctly).

> I honestly do not know who is right or wrong in this situation.

Since it is easy for cscc to deal with both forms, just as Rotor does, it 
isn't really a case of right or wrong for us, but handling odd boundary cases 
in a rational manner.  Cscc itself will continue to generate the enum-typed 
version for fields, just as csc and Rotor do.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]