Bugzilla – Bug 317027
[GMCS]: Problem with events
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by spigaz@gmail.com 2005-01-27 12:18:44 MST ---- 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 ---- Additional Comments From martin@ximian.com 2005-03-01 21:25:22 MST ---- Fixed in SVN. This bug depended on bug(s) 71865. Unknown bug field "cf_op_sys_details" encountered while moving bug <cf_op_sys_details>Gentoo 2.6.10</cf_op_sys_details> Unknown operating system unknown. Setting to default OS "Other".