'base_function':覆寫虛擬函式傳回類型與 'override_function' 不同
備註
衍生類別中的函式嘗試覆寫基類中的虛擬函式,但衍生類別函式沒有與基類函式相同的傳回型別。 覆寫函式簽章必須符合所覆寫函式的簽章。
Example
下列範例會產生 C2553:
// C2553.cpp
// compile with: /clr /c
ref struct C {
virtual void f();
};
ref struct D : C {
virtual int f() override ; // C2553
// try the following line instead
// virtual void f() override;
};