mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 09:09:47 +01:00
* bug #294 fixed: parameters can have now the same name as the function/
procedure, this is compatible with TP/Delphi
This commit is contained in:
parent
c8a9e40f5b
commit
2805167e6e
@ -1788,7 +1788,10 @@ implementation
|
||||
(next^.symtabletype=parasymtable) then
|
||||
begin
|
||||
hsym:=next^.search(sym^.name);
|
||||
if assigned(hsym) then
|
||||
{ a parameter and the function can have the same }
|
||||
{ name in TP and Delphi }
|
||||
if assigned(hsym) and
|
||||
(sym^.typ<>funcretsym) then
|
||||
DuplicateSym(hsym);
|
||||
end
|
||||
else if (current_module^.flags and uf_local_browser)=0 then
|
||||
@ -1804,11 +1807,17 @@ implementation
|
||||
(next^.next^.symtabletype=objectsymtable) then
|
||||
begin
|
||||
hsym:=search_class_member(pobjectdef(next^.next^.defowner),sym^.name);
|
||||
{ but private ids can be reused }
|
||||
if assigned(hsym) and
|
||||
{ private ids can be reused }
|
||||
(not(sp_private in hsym^.symoptions) or
|
||||
(hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
|
||||
DuplicateSym(hsym);
|
||||
begin
|
||||
{ delphi allows to reuse the names of properties }
|
||||
{ in procedures }
|
||||
if not((hsym^.typ=propertysym) and
|
||||
(m_delphi in aktmodeswitches)) then
|
||||
DuplicateSym(hsym);
|
||||
end;
|
||||
end;
|
||||
{ check for duplicate id in para symtable of methods }
|
||||
if (symtabletype=parasymtable) and
|
||||
@ -1823,16 +1832,16 @@ implementation
|
||||
begin
|
||||
hsym:=search_class_member(procinfo^._class,sym^.name);
|
||||
if assigned(hsym) and
|
||||
{ delphi allows to reuse the names of properties }
|
||||
{ in parameter lists of methods }
|
||||
not(
|
||||
(hsym^.typ<>propertysym) or
|
||||
(m_delphi in aktmodeswitches)
|
||||
) and
|
||||
{ also private ids can be reused }
|
||||
{ private ids can be reused }
|
||||
(not(sp_private in hsym^.symoptions) or
|
||||
(hsym^.owner^.defowner^.owner^.symtabletype<>unitsymtable)) then
|
||||
DuplicateSym(hsym);
|
||||
begin
|
||||
{ delphi allows to reuse the names of properties }
|
||||
{ in parameter lists of methods }
|
||||
if not((hsym^.typ=propertysym) and
|
||||
(m_delphi in aktmodeswitches)) then
|
||||
DuplicateSym(hsym);
|
||||
end;
|
||||
end;
|
||||
{ check for duplicate field id in inherited classes }
|
||||
if (sym^.typ=varsym) and
|
||||
@ -2799,7 +2808,11 @@ implementation
|
||||
end.
|
||||
{
|
||||
$Log$
|
||||
Revision 1.81 2000-03-20 09:34:33 florian
|
||||
Revision 1.82 2000-03-22 09:25:57 florian
|
||||
* bug 294 fixed: parameters can have now the same name as the function/
|
||||
procedure, this is compatible with TP/Delphi
|
||||
|
||||
Revision 1.81 2000/03/20 09:34:33 florian
|
||||
* in delphi mode: method parameters can now have the same name as parameters
|
||||
|
||||
Revision 1.80 2000/03/01 13:56:31 pierre
|
||||
|
||||
Loading…
Reference in New Issue
Block a user