What exactly is a "Special Class"?

From the Roslyn source code, it looks like a list of hardcoded types in isValidConstraintType:

switch (type.SpecialType)
{
    case SpecialType.System_Object:
    case SpecialType.System_ValueType:
    case SpecialType.System_Enum:
    case SpecialType.System_Delegate:
    case SpecialType.System_MulticastDelegate:
    case SpecialType.System_Array:
        // "Constraint cannot be special class '{0}'"
        Error(diagnostics, ErrorCode.ERR_SpecialTypeAsBound, syntax, type);
        return false;
}
  • isValidConstraintType in GitHub (updated with new types)
  • IsValidConstraintType is Roslyn Source Browser
  • I've found it using a GitHub search: "A constraint cannot be special class".

According to MSDN it's a static list of classes:

Compiler Error CS0702

Constraint cannot be special class 'identifier' The following types may not be used as constraints:

  • System.Object
  • System.Array
  • System.Delegate
  • System.Enum
  • System.ValueType.

I found a Jon Skeet comment from 2008 on a similar question: Why is the System.Enum constraint not supported.

I know this is a bit off topic, but he asked Eric Lippert (the C# team) about it and they provided this answer:

First off, your conjecture is correct; the restrictions on constraints are by and large artefacts of the language, not so much the CLR. (Were we to do these features there would be a few minor things we'd like to change in the CLR regarding how enumerable types are specified, but mostly this would be language work.)

Second, I would personally love to have delegate constraints, enum constraints, and the ability to specify constraints that are illegal today because the compiler is trying to save you from yourself. (That is, making sealed types legal as constraints, and so on.)

However, due to scheduling restrictions, we will likely not be able to get these features into the next version of the language.