[Mono-bugs] [Bug 70488][Maj] New - EnumBuilder not generating code
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Sun, 12 Dec 2004 13:58:04 -0500 (EST)
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by bmaurer@users.sf.net.
http://bugzilla.ximian.com/show_bug.cgi?id=70488
--- shadow/70488 2004-12-12 13:58:04.000000000 -0500
+++ shadow/70488.tmp.32099 2004-12-12 13:58:04.000000000 -0500
@@ -0,0 +1,125 @@
+Bug#: 70488
+Product: Mono: Runtime
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: bmaurer@users.sf.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: EnumBuilder not generating code
+
+On Mono:
+[benm@omega benm]$ cat t.cs
+using System;
+using System.Threading;
+using System.Reflection;
+using System.Reflection.Emit;
+
+public class X {
+ public static void Main()
+ {
+ AssemblyName an = new AssemblyName ();
+ an.Name = "Blah";
+
+ AssemblyBuilder ab = Thread.GetDomain
+().DefineDynamicAssembly (an, AssemblyBuilderAccess.Save);
+ ModuleBuilder mb = ab.DefineDynamicModule ("Blah", "Blah.dll");
+ EnumBuilder eb = mb.DefineEnum("Foo",
+TypeAttributes.Public, typeof (int));
+
+ eb.DefineLiteral("Bar", 1);
+ eb.DefineLiteral("Baz", 2);
+
+ eb.CreateType();
+ ab.Save("Blah.dll");
+ }
+}
+[benm@omega benm]$ mcs t.cs
+[benm@omega benm]$ mono t.exe
+[benm@omega benm]$ monodis Blah.dll
+.assembly 'Blah'
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module Blah // GUID = {A3D72C0E-29C0-4137-A654-8D44ECDB797C}
+
+
+[benm@omega benm]$
+
+
+On msft:
+
+C:\Inetpub\ftproot>t
+
+C:\Inetpub\ftproot>ildasm /text blah.dll
+
+// Microsoft (R) .NET Framework IL Disassembler. Version 1.1.4322.573
+// Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
+
+.assembly extern mscorlib
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) //
+.z\V.4
+..
+ .ver 1:0:5000:0
+}
+.assembly Blah
+{
+ .hash algorithm 0x00008004
+ .ver 0:0:0:0
+}
+.module Blah
+// MVID: {F4B57E2E-CCC1-4F43-965F-8AD549B945B5}
+.imagebase 0x00400000
+.subsystem 0x00000003
+.file alignment 512
+.corflags 0x00000001
+// Image base: 0x02b50000
+//
+// ============== CLASS STRUCTURE DECLARATION ==================
+//
+.class public auto ansi sealed Foo
+ extends [mscorlib]System.Enum
+{
+} // end of class Foo
+
+
+// =============================================================
+
+
+// =============== GLOBAL FIELDS AND METHODS ===================
+
+
+// =============================================================
+
+
+// =============== CLASS MEMBERS DECLARATION ===================
+// note that class flags, 'extends' and 'implements' clauses
+// are provided here for information only
+
+.class public auto ansi sealed Foo
+ extends [mscorlib]System.Enum
+{
+ .field private specialname rtspecialname int32 value__
+ .field public static literal int32 Bar = int32(0x00000001)
+ .field public static literal int32 Baz = int32(0x00000002)
+} // end of class Foo
+
+
+// =============================================================
+
+//*********** DISASSEMBLY COMPLETE ***********************
+
+C:\Inetpub\ftproot>
+
+
+Note that we do not actually generate the enum type (!!!)