Bug 317027 (MONO71866) - [GMCS]: Problem with events
Summary: [GMCS]: Problem with events
Status: RESOLVED FIXED
Alias: MONO71866
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Minor
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-27 19:18 UTC by José Faria
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:05:34 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".