What exactly is a “Special Class”?

后端 未结 7 1961
鱼传尺愫
鱼传尺愫 2020-12-23 13:21

After failing to get something like the following to compile:

public class Gen where T : System.Array
{
}

with the error

7条回答
  •  孤独总比滥情好
    2020-12-23 13:36

    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.

提交回复
热议问题