JetBrains Rider 2024.3 Help

Code inspection: Class with virtual (overridable) members never inherited (private accessibility)

This inspection reports private classes that have one or more overridable members (virtual in C# or Overridable in Visual Basic), but have no inheritors in the current local scope.

On the one hand, making a member overridable indicates an intention to override it in a subclass, but on the other hand, there are no subclasses.

To resolve this contradiction, consider removing the virtual or Overridable modifiers. If the class is intentionally designed not to have any inheritors, you could add the sealed (NotInheritable in Visual Basic) modifier to the class.

Last modified: 27 May 2024