[Mono-bugs] [Bug 71305][Wis] New - Should throw exception

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 14 Jan 2005 19:32:21 -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 miguel@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=71305

--- shadow/71305	2005-01-14 19:32:21.000000000 -0500
+++ shadow/71305.tmp.14617	2005-01-14 19:32:21.000000000 -0500
@@ -0,0 +1,50 @@
+Bug#: 71305
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Should throw exception
+
+The following program should print Success:
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+using System.Threading;
+
+class X {
+	static string ASSEMBLY_NAME =
+"MonoTests.System.Reflection.Emit.TypeBuilderTest";
+	static private AssemblyBuilder assembly;
+	static private ModuleBuilder module;
+
+	static void Main ()
+	{
+		AssemblyName assemblyName = new AssemblyName();
+		assemblyName.Name = ASSEMBLY_NAME;
+
+		assembly = 
+			Thread.GetDomain().DefineDynamicAssembly(
+				assemblyName, AssemblyBuilderAccess.RunAndSave, "c:\\");
+
+		module = assembly.DefineDynamicModule("module1");
+		TypeBuilder tb = module.DefineType ("xx");
+		try {
+		ConstructorInfo cb = tb.TypeInitializer;
+		} catch (NotSupportedException){
+			Console.WriteLine ("Success");
+		}
+
+	}
+}