Compartir a través de


Error del compilador C3901

"accessor_function": debe tener el tipo de valor devuelto "type"

Observaciones

Al menos un tipo de valor devuelto del método get debe coincidir con el tipo de propiedad. Para obtener más información, consulta property.

Example

En el siguiente ejemplo se genera C3901:

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

ref class Y {
   property double values[int, int] {
      int get(int, int);   // C3901
      // try the following line instead
      // double get(int, int);
   };
};