編譯器錯誤 C3798
'specifier': 屬性宣告不能有覆寫規範(應該改為放在屬性 get/set 方法上)
屬性宣告不正確。 如需更多資訊,請參閱
範例
下列範例會產生 C3798
// C3798.cpp
// compile with: /clr /c
ref struct A {
property int Prop_1 abstract; // C3798
property int Prop_2 sealed; // C3798
// OK
property int Prop_3 {
virtual int get() abstract;
virtual void set(int i) abstract;
}
property int Prop_4 {
virtual int get() sealed;
virtual void set(int i) sealed;
}
};