I've noticed a recurring bug in Delphi 7 that is really puzzling me.

What happens is, I'm testing an "ActiveX library" project (running a Delphi 7 executable, also within the project group), and occasionally rebuilding the library project will cause functions to be duped in the co-class .pas file. The functions that are duped are redirected via those duped functions, but these are empty inside. And if it's a function that returns an IDispatch, it omits the word IDispatch.. resulting in build error messages.

Code:
    function ReadFile(const FileName: WideString; var MapFileRec: IMapFileRec;
      var bSupport: WordBool): IDispatch; safecall;
    function TranslateFromNativeFormat(const FileRec: IMapFileRec): IDispatch;
      safecall;
    function TranslateToNativeFormat(const SemiMapData: IDispatch;
      FormatType: TMWHFileDataType): IMapFileRec; safecall;
    procedure WriteFile(const aSemiMapData: IDispatch;
      const FileName: WideString; FileType: TMWHFileDataType); safecall;  function ISemiMapFile.ReadFile = ISemiMapFile_ReadFile;
    function ISemiMapFile.TranslateFromNativeFormat = ISemiMapFile_TranslateFromNativeFormat;
    function ISemiMapFile.TranslateToNativeFormat = ISemiMapFile_TranslateToNativeFormat;
  
    function ISemiMapFile_ReadFile(const FileName: WideString;
      var MapFileRec: IMapFileRec; var bSupport: WordBool): ; safecall;
    function ISemiMapFile_TranslateFromNativeFormat(
      const FileRec: IMapFileRec): ; safecall;
    function ISemiMapFile_TranslateToNativeFormat(const SemiMapData;
      FormatType: TMWHFileDataType): IMapFileRec; safecall;
And the following is added in the implementation section:
Code:
function TSemiMapFile.ISemiMapFile_ReadFile(const FileName: WideString;
  var MapFileRec: IMapFileRec; var bSupport: WordBool): ;
begin

end;

function TSemiMapFile.ISemiMapFile_TranslateFromNativeFormat(
  const FileRec: IMapFileRec): ;
begin

end;

function TSemiMapFile.ISemiMapFile_TranslateToNativeFormat(
  const SemiMapData; FormatType: TMWHFileDataType): IMapFileRec;
begin

end;
This example caused a build error, so it's easily spotted and fixed, but I've had occurances where functions were effectively dummied out because of the dupes with me none the wiser (until the software started to fail where it didn't before).

It would be nice to know if anyone ever has had similar issues, and a way to steer away from the iceburg, rather then patch the holes as they appear.