mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 16:49:23 +02:00
compiler: check that records methods have implementation too. previously check worked only for some object types
git-svn-id: trunk@16609 -
This commit is contained in:
parent
92d6503704
commit
bf3c098c18
@ -183,6 +183,7 @@ interface
|
|||||||
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
constructor ppuload(dt:tdeftyp;ppufile:tcompilerppufile);
|
||||||
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
destructor destroy; override;
|
destructor destroy; override;
|
||||||
|
procedure check_forwards; virtual;
|
||||||
function find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
function find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
||||||
function GetSymtable(t:tGetSymtable):TSymtable;override;
|
function GetSymtable(t:tGetSymtable):TSymtable;override;
|
||||||
function is_packed:boolean;
|
function is_packed:boolean;
|
||||||
@ -305,7 +306,7 @@ interface
|
|||||||
function needs_inittable : boolean;override;
|
function needs_inittable : boolean;override;
|
||||||
function rtti_mangledname(rt:trttitype):string;override;
|
function rtti_mangledname(rt:trttitype):string;override;
|
||||||
function vmt_mangledname : string;
|
function vmt_mangledname : string;
|
||||||
procedure check_forwards;
|
procedure check_forwards; override;
|
||||||
procedure insertvmt;
|
procedure insertvmt;
|
||||||
procedure set_parent(c : tobjectdef);
|
procedure set_parent(c : tobjectdef);
|
||||||
function find_destructor: tprocdef;
|
function find_destructor: tprocdef;
|
||||||
@ -2607,6 +2608,11 @@ implementation
|
|||||||
inherited destroy;
|
inherited destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure tabstractrecorddef.check_forwards;
|
||||||
|
begin
|
||||||
|
tstoredsymtable(symtable).check_forwards;
|
||||||
|
end;
|
||||||
|
|
||||||
function tabstractrecorddef.find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
function tabstractrecorddef.find_procdef_bytype(pt:tproctypeoption): tprocdef;
|
||||||
var
|
var
|
||||||
i: longint;
|
i: longint;
|
||||||
@ -4485,7 +4491,7 @@ implementation
|
|||||||
procedure tobjectdef.check_forwards;
|
procedure tobjectdef.check_forwards;
|
||||||
begin
|
begin
|
||||||
if not(objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcprotocol]) then
|
if not(objecttype in [odt_interfacecom,odt_interfacecorba,odt_dispinterface,odt_objcprotocol]) then
|
||||||
tstoredsymtable(symtable).check_forwards;
|
inherited;
|
||||||
if (oo_is_forward in objectoptions) then
|
if (oo_is_forward in objectoptions) then
|
||||||
begin
|
begin
|
||||||
{ ok, in future, the forward can be resolved }
|
{ ok, in future, the forward can be resolved }
|
||||||
|
@ -558,8 +558,8 @@ implementation
|
|||||||
if (tsym(sym).typ=typesym) and
|
if (tsym(sym).typ=typesym) and
|
||||||
assigned(ttypesym(sym).typedef) and
|
assigned(ttypesym(sym).typedef) and
|
||||||
(ttypesym(sym).typedef.typesym=ttypesym(sym)) and
|
(ttypesym(sym).typedef.typesym=ttypesym(sym)) and
|
||||||
(ttypesym(sym).typedef.typ=objectdef) then
|
(ttypesym(sym).typedef.typ in [objectdef,recorddef]) then
|
||||||
tobjectdef(ttypesym(sym).typedef).check_forwards;
|
tabstractrecorddef(ttypesym(sym).typedef).check_forwards;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user