[Mono-bugs] [Bug 24992] New - EventInfo.GetAddMethod() and GetRemoveMethod() need implementing

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
20 May 2002 17:44:24 -0000


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 joe@ximian.com.

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

--- shadow/24992	Mon May 20 13:44:24 2002
+++ shadow/24992.tmp.30968	Mon May 20 13:44:24 2002
@@ -0,0 +1,53 @@
+Bug#: 24992
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: joe@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: EventInfo.GetAddMethod() and GetRemoveMethod() need implementing
+
+The build of gtk# is now dying with the following error from mcs:
+
+** (process:18995): WARNING **: unhandled exception
+System.NullReferenceException: "A null value was found where an object
+instance was required"
+in 0x00075 Mono.CSharp.EventExpr:.ctor
+(System.Reflection.EventInfo,Mono.CSharp.Location)
+in 0x00095 Mono.CSharp.Expression:ExprClassFromMemberInfo
+(Mono.CSharp.EmitContext,System.Reflection.MemberInfo,Mono.CSharp.Location)
+in 0x0015d Mono.CSharp.Expression:MemberLookup
+(Mono.CSharp.EmitContext,System.Type,string,System.Reflection.MemberTypes,System.Reflection.BindingFlags,Mono.CSharp.Location)
+[ ... ]
+
+In mcs/ecore.cs, EventExpr's constructor:
+
+    add_accessor = TypeManager.GetAddMethod (ei);
+    remove_accessor = TypeManager.GetRemoveMethod (ei);
+                        
+    if (add_accessor.IsStatic || remove_accessor.IsStatic)
+        IsStatic = true;
+
+which is raising the NullReferenceException, because in
+class/corlib/System.Reflection/EventInfo.cs:
+
+    public MethodInfo GetAddMethod() {
+        return null;
+    }
+    public abstract MethodInfo GetAddMethod(bool nonPublic);
+    public MethodInfo GetRaiseMethod() {
+        return null;
+    }
+    public abstract MethodInfo GetRaiseMethod( bool nonPublic);
+    public MethodInfo GetRemoveMethod() {
+        return null;
+    }