다음을 통해 공유


컴파일러 오류 CS1728

'member'는 'type'의 멤버이므로 대리자를 바인딩할 수 없습니다.

Nullable 값 형식의 멤버에 대리자를 바인딩할 수 없습니다.

예시

다음 샘플에서는 CS1728을 생성합니다.

// CS1728.cs  
class Test  
{  
   delegate T GetT<T>();  
   delegate T GetT1<T>(T t);  
  
   delegate bool E(object o);  
   delegate int I();  
   delegate string S();  
  
   static void Main()  
   {  
      int? x = null;  
      int? y = 5;  
  
      GetT<int> d1 = x.GetValueOrDefault;   // CS1728  
      GetT<int> d2 = y.GetValueOrDefault;   // CS1728  
      GetT1<int> d3 = x.GetValueOrDefault;   // CS1728  
      GetT1<int> d4 = y.GetValueOrDefault;   // CS1728  
   }  
}