[Mono-bugs] [Bug 71865][Maj] New - Generic Problem with Event
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 27 Jan 2005 12:16:22 -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 spigaz@gmail.com.
http://bugzilla.ximian.com/show_bug.cgi?id=71865
--- shadow/71865 2005-01-27 12:16:22.000000000 -0500
+++ shadow/71865.tmp.16745 2005-01-27 12:16:22.000000000 -0500
@@ -0,0 +1,75 @@
+Bug#: 71865
+Product: Mono: Compilers
+Version: 1.1
+OS:
+OS Details: Gentoo 2.6.10
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: spigaz@gmail.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Generic Problem with Event
+
+Description of Problem:
+gmcs reportes wrongly that an event variable isn't used.
+
+Steps to reproduce the problem:
+1. Insert into a file:
+
+namespace FLMID.Bugs.EventOne
+{
+ public delegate void Changed<T>(A<T> a);
+
+
+ public class A<T>
+
+ {
+
+ protected event Changed<T> _changed;
+
+
+
+ public void Register(Changed<T> changed)
+
+ {
+
+ _changed += changed;
+ _changed(this);
+
+ }
+
+ }
+ public class Test
+ {
+ public static void Main(string[] args)
+ {
+ A<int> a = new A<int>();
+ a.Register(new Changed<int>(Del));
+ }
+ public static void Del(A<int> a)
+ {
+ System.Console.WriteLine("Solved");
+ }
+ }
+}
+2. try to compile it
+3.
+
+Actual Results:
+/projects/FLMID/Bugs/EventOne/src/Test.cs(8) error CS0067: The event
+'FLMID.Bugs.EventOne.A`1._changed' is never used
+
+Expected Results:
+Solved
+
+How often does this happen?
+always
+
+Additional Information:
+It works fine on .Net 2.0