[Mono-bugs] [Bug 71866][Maj] New - Generic Problem with Event (2)

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 27 Jan 2005 12:18:45 -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=71866

--- shadow/71866	2005-01-27 12:18:45.000000000 -0500
+++ shadow/71866.tmp.16844	2005-01-27 12:18:45.000000000 -0500
@@ -0,0 +1,81 @@
+Bug#: 71866
+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 (2)
+
+Description of Problem:
+For some reason it doesn't allow me to add a delegate to an event.
+
+Steps to reproduce the problem:
+1. Insert into a file:
+
+namespace FLMID.Bugs.EventTwo
+{
+
+	public class A<T>
+
+	{
+		public delegate void Changed(A<T> a);
+		
+
+		protected event Changed _changed;
+
+		
+
+		public void Register(Changed changed)
+
+		{
+
+			_changed += changed;
+			_changed(this);
+
+		}
+
+	}
+	public class Test
+	{
+		public static void Main(string[] args)
+		{
+			A<int> a = new A<int>();
+			a.Register(new A<int>.Changed(Del));
+		}
+		public static void Del(A<int> a)
+		{
+			System.Console.WriteLine("Solved");
+		}
+	}
+}
+2. 
+3. 
+
+Actual Results:
+/projects/FLMID/Bugs/EventTwo/src/Test.cs(14) error CS0019: Operator +
+cannot be applied to operands of type `FLMID.Bugs.EventTwo.A`1.Changed' and
+`FLMID.Bugs.EventTwo.A`1.Changed'
+/projects/FLMID/Bugs/EventTwo/src/Test.cs(10) error CS0067: The event
+'FLMID.Bugs.EventTwo.A`1._changed' is never used
+
+Yes, it also reproduces the bug from the last report, I reported them both
+because i think it would be simpler to fix this one afterwards...
+
+Expected Results:
+Solved
+
+How often does this happen? 
+Always
+
+Additional Information:
+It works fine on .Net 2.0