編譯器錯誤 C3901
'accessor_function': 必須有傳回類型 'type'
至少一個 get 方法的傳回類型必須符合屬性類型。 如需詳細資訊,請參閱 property。
下列範例會產生 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);
};
};