컴파일러 오류 CS0674
업데이트: 2007년 11월
오류 메시지
'System.ParamArrayAttribute'를 사용하지 마십시오. 대신 'params' 키워드를 사용하십시오.
Do not use 'System.ParamArrayAttribute'. Use the 'params' keyword instead.
C# 컴파일러에서는 System.ParamArrayAttribute 사용을 허용하지 않습니다. 대신 params를 사용하십시오.
다음 샘플에서는 CS0674 오류가 발생하는 경우를 보여 줍니다.
// CS0674.cs
using System;
public class MyClass
{
public static void UseParams([ParamArray] int[] list) // CS0674
// try the following line instead
// public static void UseParams(params int[] list)
{
for ( int i = 0 ; i < list.Length ; i++ )
Console.WriteLine(list[i]);
Console.WriteLine();
}
public static void Main()
{
UseParams(1, 2, 3);
}
}