bugDotGNU Portable.NET - Bugs: bug #2150, cscc does not interoperate with...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #2150: cscc does not interoperate with mcs-compiled libraries containing enums

Submitted by:  Marcus Urban <mathpup>
Submitted on:  Tue 07 Jan 2003 08:48:54 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 07 Jan 2003 10:19:23 AM UTC, comment #1:

Should be fixed now (7 Jan 2003), but I don't have mcs
here to test it. Let me know if it is still broken.

Rhys Weatherley <rweather>
Project Administrator
Tue 07 Jan 2003 08:48:54 AM UTC, original submission:

When a library containing enums is compiled with mcs, cscc does not recognize the enum's members as having the correct type.

I'm going to quote from the bug report I submitted on Mono's site:

The IL that mcs produces for enums differs from that of csc. Consider, for example, the code

public class QFont
{
public enum Weight {
Light = 25, Normal = 50, DemiBold = 63, Bold = 75, Black = 87 }
}

For the enum declaration, csc produces

.class nested public auto sealed ansi Weight extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype QFont/Weight Light = int32(0x00000019)
.field public static literal valuetype QFont/Weight Normal = int32(0x00000032)
.field public static literal valuetype QFont/Weight DemiBold =
int32(0x0000003F)
.field public static literal valuetype QFont/Weight Bold = int32(0x0000004B)
.field public static literal valuetype QFont/Weight Black = int32(0x00000057)
}

whereas mcs produces

.class nested public auto sealed ansi Weight extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal int32 Light = int32(0x00000019)
.field public static literal int32 Normal = int32(0x00000032)
.field public static literal int32 DemiBold = int32(0x0000003F)
.field public static literal int32 Bold = int32(0x0000004B)
.field public static literal int32 Black = int32(0x00000057)
}

Note that the static fields have type "int32" in mcs's version but "valuetype" in csc's.

The typical effect of this problem is that cscc thinks that QFont.Weight.Bold has type int, rather than QFont.Weight! By the way, Rotor's csc does not complain about this issue. Surprisingly, it appears to be more flexible on this point.

In any case, I'm not entirely sure whose "fault" this is, but upshot is that mcs-compiled Qt.dll cannot be used with cscc.

Marcus Urban <mathpup>

 

Attached Files
file #226:  QFont.cs added by mathpup (112B - text/x-csharp - Compile QFont with mcs: mcs /target:library QFont. Then attempt cscc -l QFont font.cs)
file #225:  font.cs added by mathpup (110B - text/x-csharp)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 07 Jan 2003 10:19:23 AM UTCrweatherStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1