[Mono-bugs] [Bug 32429][Nor] New - compiler mishandles static event references
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
17 Oct 2002 06:43:36 -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 ianm@activestate.com.
http://bugzilla.ximian.com/show_bug.cgi?id=32429
--- shadow/32429 Thu Oct 17 02:43:36 2002
+++ shadow/32429.tmp.28352 Thu Oct 17 02:43:36 2002
@@ -0,0 +1,56 @@
+Bug#: 32429
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: ianm@activestate.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: compiler mishandles static event references
+
+Description of Problem:
+the compiler mishandles static event references.in the following example it
+mistakenly thinks that BuildStarted is non static.
+
+Steps to reproduce the problem:
+1. compile the following code on both csc and mcs
+class foo {
+
+ public delegate void BuildEventHandler(object sender, object e);
+ public static event BuildEventHandler BuildStarted;
+
+ static void static1()
+ {
+ if (BuildStarted != null) {
+ BuildStarted( null, null );
+ }
+ }
+
+ static void Main(string[] args){
+
+ }
+}
+
+
+Actual Results:
+staticbug.cs(9) error CS0120: An object reference is required for the
+non-static field `BuildStarted'
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+
+clean compile as it referencing a static member.
+
+How often does this happen?
+
+all the time
+
+Additional Information: