Udostępnij za pomocą


Błąd kompilatora C3901

"accessor_function": musi mieć typ zwracany "type"

Uwagi

Co najmniej jeden typ zwracany metody get musi być zgodny z typem właściwości. Aby uzyskać więcej informacji, zobacz właściwość.

Example

Poniższy przykład generuje kod 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);
   };
};