Code inspection: Class can be made sealed (non-inheritable) (private accessibility)
This inspection reports non-public classes that can be marked sealed based on local usage analysis.
It is useful for classes that are not intended to be base classes, because sealing them makes that intent explicit and can simplify further analysis and refactoring.
Example
In this example, the Helper class is not used as a base class within the current file. The quick-fix helps you mark it as sealed.
class Helper
{
void Log()
{
}
}
sealed class Helper
{
void Log()
{
}
}
Quick-fix
The quick-fix makes the class sealed. If needed, the quick-fix also updates non-override virtual members inside the class so the resulting sealed type stays consistent.
27 March 2026