Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C3246

Error Message

'class' : cannot inherit from 'type' as it has been declared as 'sealed'

A class that is marked as sealed cannot be the base class for any other classes.

The following sample generates C3246:

// C3246_2.cpp
// compile with: /clr /LD
ref class X sealed {};

ref class Y : public X {}; // C3246

The following sample generates C3246:

// C3246.cpp
// compile with: /clr:oldSyntax /LD
#using <mscorlib.dll>
__sealed __gc class X {};

__gc class Y : public X {}; // C3246

Community Additions

ADD
Show:
© 2015 Microsoft