[Mono-dev] Mono-1.2.4-gmcs-BUG,help me
lei.min gmx
lei.min at gmx.de
Sat Aug 25 13:09:42 EDT 2007
Hello, mono-developers
i have downloaded mono-1.2.4 sources, and build the gmcs.exe under MS Visual C# 2005. it can be well builded.
The gmcs.exe can also compile my C# sources without the enum type very well.
if i try to compile the source with enum type, it will throw the InvalidOperationException ("enum basetype is not defined");
i have tried myself to debug it. and patched 2 files in gmcs sources:
1. mcs\typemanager.cs
//public static void AddUserType(DeclSpace ds)
//{
//+ if (ds is Enum)
//+ {
//+ ds.TypeBuilder = ds.DefineType();
//+ }
// builder_to_declspace.Add(ds.TypeBuilder, ds);
//} line 401,410 typemanager.cs patch for the Enum to remove:
// InvalidOperationException ("enum basetype is not defined");
//
2. mcs\ecore.cs
//public override object GetTypedValue ()
//{
//// FIXME: runtime is not ready to work with just emited enums
//if (!RootContext.StdLib) {
//return Child.GetValue ();
//}
//
//+ return Child.GetValue();
//-return System.Enum.ToObject (type, Child.GetValue ());
//} line 1538,1547 ecore.cs patch for the Enum to remove:
// ArgumentException ("enumType must be a runtime type");
then i can use gmcs.exe to compile my C#-source with enum type.
Although it works now well, i don't know, if it is right ,what i did.
So i want to get the right answer to resolve the problem.
Thanks
lei.min gmx
2007-08-25
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070825/2d51cd0e/attachment.html
More information about the Mono-devel-list
mailing list