컴파일러 오류 CS0102
업데이트: 2007년 11월
오류 메시지
'type name' 형식에 이미 'identifier'에 대한 정의가 포함되어 있습니다.
The type 'type name' already contains a definition for 'identifier'
동일한 범위에서 이름이 같은 여러 개의 식별자 선언이 클래스에 포함되어 있습니다. 이 오류를 해결하려면 중복된 식별자의 이름을 바꿉니다.
예제
다음 샘플에서는 CS0102 오류가 발생하는 경우를 보여 줍니다.
// CS0102.cs
// compile with: /target:library
namespace MyApp
{
public class MyClass
{
string s = "Hello";
string s = "Goodbye"; // CS0102
public void GetString()
{
string s = "Hello again"; // method scope, no error
}
}
}