Compiler Error C3246
TOC
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

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
Show:
© 2016 Microsoft