From 4f913922faa4021951cdbdec07f434224d5c8f76 Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 13 Feb 2004 15:41:24 +0000 Subject: [PATCH] * overload directive checking for methods is now done when the vmt is generated --- compiler/nobj.pas | 18 +++++++++++++++++- compiler/pdecsub.pas | 12 ++++++++---- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/compiler/nobj.pas b/compiler/nobj.pas index b8443f95c1..93e2e78438 100644 --- a/compiler/nobj.pas +++ b/compiler/nobj.pas @@ -623,6 +623,18 @@ implementation { compare only if the definition is not hidden } if not procdefcoll^.hidden then begin + { check that all methods have overload directive } + if not(m_fpc in aktmodeswitches) and + (_class=pd._class) and + (procdefcoll^.data._class=pd._class) and + ((po_overload in pd.procoptions)<>(po_overload in procdefcoll^.data.procoptions)) then + begin + MessagePos1(pd.fileinfo,parser_e_no_overload_for_all_procs,pd.procsym.realname); + { recover } + include(procdefcoll^.data.procoptions,po_overload); + include(pd.procoptions,po_overload); + end; + { check if one of the two methods has virtual } if (po_virtualmethod in procdefcoll^.data.procoptions) or (po_virtualmethod in pd.procoptions) then @@ -1367,7 +1379,11 @@ initialization end. { $Log$ - Revision 1.60 2004-02-08 23:30:43 florian + Revision 1.61 2004-02-13 15:41:24 peter + * overload directive checking for methods is now done + when the vmt is generated + + Revision 1.60 2004/02/08 23:30:43 florian * web bug 2942 fixed: reintroduce isn't necessary in methods of child classes of course Revision 1.59 2004/01/28 20:30:18 peter diff --git a/compiler/pdecsub.pas b/compiler/pdecsub.pas index f3be5009fe..020c17f071 100644 --- a/compiler/pdecsub.pas +++ b/compiler/pdecsub.pas @@ -2099,10 +2099,10 @@ const if ((po_overload in pd.procoptions) or (po_overload in hd.procoptions)) then begin - { check if all procs have overloading, but not if the proc was - already declared forward or abstract, then the check is already done } + { check if all procs have overloading, but not if the proc is a method or + already declared forward, then the check is already done } if not(hd.hasforward or - (po_abstractmethod in hd.procoptions) or + assigned(pd._class) or (pd.forwarddef<>hd.forwarddef) or ((po_overload in pd.procoptions) and (po_overload in hd.procoptions))) then @@ -2139,7 +2139,11 @@ const end. { $Log$ - Revision 1.161 2004-02-05 14:13:53 daniel + Revision 1.162 2004-02-13 15:41:24 peter + * overload directive checking for methods is now done + when the vmt is generated + + Revision 1.161 2004/02/05 14:13:53 daniel * Tvarsym.highvarsym removed Revision 1.160 2004/02/04 22:54:57 daniel