[Mono-bugs] [Bug 55247][Nor] New - Mono Fails to Throw Exceptions in TypeBuilder but .NET does

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 6 Mar 2004 03:47:47 -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 mathpup@mylinuxisp.com.

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

--- shadow/55247	2004-03-06 03:47:46.000000000 -0500
+++ shadow/55247.tmp.24426	2004-03-06 03:47:46.000000000 -0500
@@ -0,0 +1,61 @@
+Bug#: 55247
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mathpup@mylinuxisp.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono Fails to Throw Exceptions in TypeBuilder but .NET does
+
+Description of Problem: 
+ 
+When creating a dynamic type using TypeBuilder, Mono permits certain 
+methods to be called on the incomplete type (i.e. before CreateType() is 
+called), whereas .NET throws an exceptions. These methods include 
+TypeBuilder.GetMethods(), TypeBuilder.GetConstructors(), and probably 
+others. (I enlisted some help in testing these methods on .NET, but I do 
+not have regular access.) 
+ 
+I notice that TypeBuilder.cs has the GetEvents() method marked with 
+// FIXME: Under MS.NET, this throws a NotImplementedException 
+// But mcs calls this method. How can that be? 
+ 
+So it is possible that GetMethods() and GetConstrutors() might be used in 
+mcs. I have not had a chance to verify this. 
+ 
+ 
+Steps to reproduce the problem: 
+1. mcs tb.cs 
+2. mono tb.exe  
+3.  
+ 
+Actual Results: 
+ 
+(No output, no errors) 
+ 
+ 
+Expected Results: (From Rotor and .NET) 
+ 
+Unhandled Exception: System.NotSupportedException: The invoked member is 
+not supported in a dynamic module. 
+   at System.Reflection.Emit.TypeBuilder.GetMethods(BindingFlags 
+bindingAttr) 
+   at System.Type.GetMethods() 
+   at Testing.Main() 
+ 
+ 
+How often does this happen?  
+ 
+Always 
+ 
+ 
+Additional Information: