这有效:
constructor TMyObj.Create; begin inherited; end;
为什么这也不起作用?
function TMyObjEx.Import(CONST FileName: string; CONST x,y,z: Integer): string; begin result:= inherited; // Import(FileName,x,z); <--- Compiler says: "incompatible types" //do other stuff here end;
TMyObjEx的声明是这样的:
TYPE TMyObj = class(TChObj) private protected public function Import (CONST FileName: string; CONST x,z: Integer): string; virtual; end; TMyObjEx= class(TMyObj) private protected public function Import(CONST FileName: string; CONST x,z: Integer): string; override; end;