Sdílet prostřednictvím


Chyba kompilátoru C3902

'accessor': typ posledního parametru musí být 'type'

Poznámky

Typ posledního parametru nejméně jedné metody set musí odpovídat typu vlastnosti. Další informace naleznete v tématu vlastnost.

Example

Následující příklad vygeneruje C3902:

// C3902.cpp
// compile with: /clr /c
using namespace System;
ref class X {
   property String ^Name {
      void set(int);   // C3902
      // try the following line instead
      // void set(String^){}
   }

   property double values[int,int] {
      void set(int, int, float);   // C3902
      // try the following line instead
      // void set(int, int, double){}
   }
};