https://bugzilla.novell.com/show_bug.cgi?id=471213
Summary: Base class method isn't called when triggered by
extending class (passed as argument to base class)
event
Classification: Mono
Product: Mono: Compilers
Version: 2.2.x
Platform: i686
OS/Version: All
Status: NEW
Severity: Normal
Priority: P5 - None
Component: C#
AssignedTo: [email protected]
ReportedBy: [email protected]
QAContact: [email protected]
Found By: Community User
Description of Problem:
Steps to reproduce the problem:
1. Compile the following using Mono:
// Inheritee.cs
using System;
public abstract class Inheritee
{
public abstract event EventHandler Finished;
public Inheritee()
{
}
public void test(Inheritee inheritee)
{
inheritee.Finished += inheriteeTest;
}
public void inheriteeTest(object sender, EventArgs e)
{
Console.WriteLine("Inheritee test method.");
}
}
// Inheritor.cs
using System;
public class Inheritor : Inheritee
{
public override event EventHandler Finished;
public Inheritor()
{
Finished += this.inheritorTest;
this.test(this);
Finished(this, EventArgs.Empty);
Console.WriteLine("Press any key to exit..");
Console.ReadKey(true);
}
public void inheritorTest(object sender, EventArgs e)
{
Console.WriteLine("Inheritor test method.");
}
public static void Main()
{
new Inheritor();
}
}
Actual Results:
Only "Inheritor test method." is displayed in console.
Expected Results:
Both "Inheritor test method." and "Inheritee test method." should be displayed.
How often does this happen?
Every time
Additional Information:
Tested using Mono 1.9x, 2.2x on Ubuntu and Gentoo respectively and 2.2x on
Windows.
When compiling on Windows using .NET 3.5 compiler (csc) the expected results
are shown correctly. (Not tested on any .NET versions prior to 3.5
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs