Compiler Error CS0502
'member' cannot be both abstract and sealed
A class member cannot be both abstract and sealed.
The following sample generates CS0502:
C#
// CS0502.cs
public class B
{
abstract public void F();
}
public class C : B
{
abstract sealed override public void F() // CS0502
{
}
}
public class CMain
{
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.
.NET feedback
.NET is an open source project. Select a link to provide feedback: