From bc06fd4d7468f93b2c0392f66cc9f8c17dbe3544 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Mon, 15 Jan 2007 21:59:43 +0000 Subject: [PATCH] * fixed mantis #6152 (allow overloads to be defined before all forwarddefs have been implemented) git-svn-id: trunk@5995 - --- .gitattributes | 1 + compiler/psub.pas | 6 +++++- tests/webtbs/tw4229a.pp | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw4229a.pp diff --git a/.gitattributes b/.gitattributes index 2ba8684ca4..27cf74ee5a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7800,6 +7800,7 @@ tests/webtbs/tw4215.pp svneol=native#text/plain tests/webtbs/tw4219.pp svneol=native#text/plain tests/webtbs/tw4223.pp svneol=native#text/plain tests/webtbs/tw4229.pp -text svneol=unset#text/plain +tests/webtbs/tw4229a.pp svneol=native#text/plain tests/webtbs/tw4233.pp svneol=native#text/plain tests/webtbs/tw4234.pp svneol=native#text/plain tests/webtbs/tw4234a.pp svneol=native#text/plain diff --git a/compiler/psub.pas b/compiler/psub.pas index 3ad93511f4..34c49aefa8 100644 --- a/compiler/psub.pas +++ b/compiler/psub.pas @@ -1496,7 +1496,11 @@ implementation (tprocsym(pd.procsym).ProcdefList.Count>1) and firstpd.forwarddef and firstpd.interfacedef and - not(tprocsym(pd.procsym).ProcdefList.Count>2) then + not(tprocsym(pd.procsym).ProcdefList.Count>2) and + { don't give an error if it may be an overload } + not(m_fpc in current_settings.modeswitches) and + (not(po_overload in pd.procoptions) or + not(po_overload in firstpd.procoptions)) then begin MessagePos1(pd.fileinfo,parser_e_header_dont_match_forward,pd.fullprocname(false)); tprocsym(pd.procsym).write_parameter_lists(pd); diff --git a/tests/webtbs/tw4229a.pp b/tests/webtbs/tw4229a.pp new file mode 100644 index 0000000000..60874dc362 --- /dev/null +++ b/tests/webtbs/tw4229a.pp @@ -0,0 +1,26 @@ +{ %fail } +{ %norun} +{ Source provided for Free Pascal Bug Report 4229 } +{ Submitted by "Gerhard" on 2005-07-28 } +{ e-mail: gs@g--s.de } +unit tw4229a ; + +interface + + type + strobj = object + bs : string ; + ba : ansistring ; + end ; + + operator := ( const a : ansistring ) z : strobj ; + +implementation + + operator := ( const s : string ) z : strobj ; + + begin + z.bs := s ; + end ; + +end.