컴파일러 오류 CS0401

업데이트: 2007년 11월

오류 메시지

new() 제약 조건은 마지막에 지정해야 합니다.
The new() constraint must be the last constraint specified

여러 개의 제약 조건을 사용하는 경우 다른 모든 제약 조건을 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
}