컴파일러 오류 CS0416
업데이트: 2007년 11월
오류 메시지
'type parameter': 특성 인수는 형식 매개 변수를 사용할 수 없습니다.
'type parameter': an attribute argument cannot use type parameters
특성 인수로 사용할 수 없는 형식 매개 변수가 사용되었습니다. 제네릭이 아닌 형식을 사용하십시오.
다음 샘플에서는 CS0416 오류가 발생하는 경우를 보여 줍니다.
// CS0416.cs
public class MyAttribute : System.Attribute
{
public MyAttribute(System.Type t)
{
}
}
class G<T>
{
[MyAttribute(typeof(G<T>))] // CS0416
public void F()
{
}
}