Freigeben über


Compilerfehler C3901

'accessor_function': muss den Rückgabetyp 'type' haben.

Bemerkungen

Mindestens ein Rückgabetyp der Get-Methode muss mit dem Eigenschaftstyp übereinstimmen. Weitere Informationen finden Sie unter property.

Example

Im folgenden Beispiel wird C3901 generiert:

// 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);
   };
};