컴파일러 경고(수준 2) CS0253
업데이트: 2007년 11월
오류 메시지
의도하지 않은 참조 비교가 있을 수 있습니다. 값 비교를 가져오려면 오른쪽을 'type' 형식으로 캐스팅하십시오.
Possible unintended reference comparison; to get a value comparison, cast the right hand side to type 'type'
컴파일러에서 참조 비교를 하고 있습니다. 문자열의 값을 비교하려면 식의 오른쪽을 type(으)로 캐스팅하십시오.
다음 샘플에서는 CS0253 오류가 발생하는 경우를 보여 줍니다.
// CS0253.cs
// compile with: /W:2
using System;
class MyClass
{
public static void Main()
{
string s = "11";
object o = s + s;
bool c = s == o; // CS0253
// try the following line instead
// bool c = s == (string)o;
}
}