[Mono-bugs] [Bug 381592] New: Accessing a protected event from within a generic class gives a CS0122: < class>.<event> is inaccessible due to its protection level.
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Fri Apr 18 20:11:35 EDT 2008
https://bugzilla.novell.com/show_bug.cgi?id=381592
Summary: Accessing a protected event from within a generic class
gives a CS0122: <class>.<event> is inaccessible due to
its protection level.
Product: Mono: Compilers
Version: SVN
Platform: x86-64
OS/Version: Ubuntu
Status: NEW
Severity: Major
Priority: P5 - None
Component: C#
AssignedTo: mono-bugs at lists.ximian.com
ReportedBy: joe at djeebus.net
QAContact: mono-bugs at lists.ximian.com
Found By: Other
The following example produces the error reliably
using System;
namespace Test
{
public static class Program
{
public static void Main(string[] args)
{
Console.WriteLine("hello world");
}
}
public abstract class Class1<T1>
{
protected event EventHandler doSomething;
}
// the generics clause is required to reproduce
// the bug. If it was defined as
// Class2 : Class1<string>, the bug is does not appear.
public class Class2<T> : Class1<T>
{
public event EventHandler DoSomething
{
add { this.doSomething += value; }
remove { this.doSomething -= value; }
}
}
}
/* the following command line:
gmcs abc.cs
results in:
abc.cs(22,36): error CS0122: `Test.Class1<T1>.doSomething' is inaccessible due
to its protection level
abc.cs(15,46): (Location of the symbol related to previous error)
abc.cs(23,39): error CS0122: `Test.Class1<T1>.doSomething' is inaccessible due
to its protection level
abc.cs(15,46): (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
*/
--
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.
More information about the mono-bugs
mailing list