注意:其他问题的标题不同,这会阻止它识别为匹配的问题。
系统类
TCollection = class(TPersistent)
protected
procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); virtual;
end;
我的单位
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes,
Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls,
Vcl.ExtCtrls, DB, System.Generics.Collections;
TTextDisplayLineInfos = class(TCollection)
protected
procedure Notify(Item: TCollectionItem; Action: TCollectionNotification); override; //Here "[dcc32 Error] MyUnit.pas(85): E2037 Declaration of 'Notify' differs from previous declaration"
end;
implementation
procedure TTextDisplayLineInfos.Notify(Item: TCollectionItem;
Action: TCollectionNotification);
begin
inherited; //Here "[dcc32 Error] MyUnit.pas(475): E2008 Incompatible types"
//..............
end;
Notify 方法的签名已经被复制粘贴了,所以不会有任何错误;
错误
在界面部分:
[dcc32 错误] MyUnit.pas(85):“通知”的 E2037 声明与之前的声明不同
在实施部分:
[dcc32 错误] MyUnit.pas(475): E2008 不兼容的类型
问题
怀有错吗?