编译器错误 CS0401
更新:2007 年 11 月
错误消息
new() 约束必须是指定的最后一个约束
使用多个约束时,请将所有其他约束列在 new() 约束之前。
示例
下面的示例生成 CS0401。
// CS0401.cs
// compile with: /target:library
using System;
class C<T> where T : new(), IDisposable {} // CS0401
class D<T> where T : IDisposable
{
static void F<U>() where U : new(), IDisposable{} // CS0401
}