Erreur du compilateur C3901

'accessor_function' : doit avoir le type de retour 'type'

Au moins un type de retour de méthode get doit correspondre au type de propriété. Pour plus d'informations, consultez property.

L’exemple suivant génère l’erreur 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);
   };
};