Compartir a través de


Error del compilador C3902

"accessor": el tipo del último parámetro debe ser "type"

El tipo del último parámetro de al menos un método set debe coincidir con el tipo de la propiedad. Para obtener más información, consulta property.

El ejemplo siguiente genera el error 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){}
   }
};