Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
'event': abstract event cannot have initializer
If an event is marked as abstract, it cannot be initialized. For more information, see Events.
The following sample generates CS0074:
// CS0074.cs
delegate void D();
abstract class Test
{
public abstract event D e = null; // CS0074
// try the following line instead
// public abstract event D e;
public static void Main()
{
}
}
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.