[Mono-bugs] [Bug 78905][Nor] Changed - System.Reflection.ModuleBuilder.GetType fails to find types with certain names
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Jul 23 02:18:43 EDT 2006
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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=78905
--- shadow/78905 2006-07-23 02:18:02.000000000 -0400
+++ shadow/78905.tmp.31242 2006-07-23 02:18:43.000000000 -0400
@@ -52,6 +52,41 @@
Searching for '<*0>.<Global>'
Got it
------- Additional Comments From miguel at ximian.com 2006-07-23 02:18 -------
The problem is that "*" is considered a type modifier, a more complete
type parser needs to be written to address this problem.
+
+------- Additional Comments From miguel at ximian.com 2006-07-23 02:18 -------
+Fully compilable version of this program:
+
+using System;
+using System.Reflection.Emit;
+using System.Reflection;
+
+class X {
+ static void Main ()
+ {
+ AssemblyBuilder ab =
+AppDomain.CurrentDomain.DefineDynamicAssembly(new
+AssemblyName("test"), AssemblyBuilderAccess.Run);
+ ModuleBuilder mb = ab.DefineDynamicModule("module");
+ TypeBuilder tb = mb.DefineType("<*0>.<Global>");
+ Type type = tb.CreateType();
+
+ foreach (Type t in type.Module.GetTypes())
+ {
+ Console.WriteLine(t.FullName);
+ }
+
+ Console.WriteLine("Searching for '{0}'", type.FullName);
+ type = type.Module.GetType(type.FullName);
+ if (type != null)
+ {
+ Console.WriteLine("Got it");
+ }
+}
+}
+
+
+The actual failure lives in mcs/class/corlib/System.Reflection.Emit
+in the ModuleBuilder.cs, GetType routine.
More information about the mono-bugs
mailing list