編譯器錯誤 CS1031
更新:2007 年 11 月
錯誤訊息
必須是型別
必須是型別參數。
範例
下列範例會產生 CS1031:
// CS1031.cs
namespace x
{
public class ii
{
}
public class a
{
public static operator +(a aa) // CS1031
// try the following line instead
// public static ii operator +(a aa)
{
return new ii();
}
public static void Main()
{
e = new base; // CS1031, not a type
e = new this; // CS1031, not a type
e = new (); // CS1031, not a type
}
}
}