컴파일러 오류 CS0572
업데이트: 2007년 11월
오류 메시지
'type' : 식을 통해 형식을 참조할 수 없습니다. 대신 'path_to_type'을(를) 시도하십시오.
'type' : cannot reference a type through an expression; try 'path_to_type' instead
식별자를 통해 클래스의 멤버에 액세스하려고 했습니다. 이는 지금과 같은 상황에서는 허용되지 않습니다.
다음 샘플에서는 CS0572 오류가 발생하는 경우를 보여 줍니다.
// CS0572.cs
using System;
class C
{
public class Inner
{
public static int v = 9;
}
}
class D : C
{
public static void Main()
{
C cValue = new C();
Console.WriteLine(cValue.Inner.v); // CS0572
// try the following line instead
// Console.WriteLine(C.Inner.v);
}
}