mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:39:31 +02:00
* allow local procsym in delphi mode
git-svn-id: trunk@8148 -
This commit is contained in:
parent
b6cca14944
commit
703b8855cc
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8349,6 +8349,7 @@ tests/webtbs/tw9161.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9162.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9167.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9174.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9176a.pp -text
|
||||
tests/webtbs/tw9179.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9187.pp svneol=native#text/plain
|
||||
tests/webtbs/tw9190.pp svneol=native#text/plain
|
||||
|
@ -1038,9 +1038,10 @@ implementation
|
||||
if not assigned(defowner) then
|
||||
internalerror(200602061);
|
||||
|
||||
{ check for duplicate field, parameter or local names
|
||||
also in inherited classes }
|
||||
if (sym.typ in [fieldvarsym,paravarsym,localvarsym]) and
|
||||
{ procsym and propertysym have special code
|
||||
to override values in inherited classes. For other
|
||||
symbols check for duplicates }
|
||||
if not(sym.typ in [procsym,propertysym]) and
|
||||
(
|
||||
not(m_delphi in current_settings.modeswitches) or
|
||||
is_object(tdef(defowner))
|
||||
@ -1057,8 +1058,7 @@ implementation
|
||||
end
|
||||
else
|
||||
begin
|
||||
if not(m_duplicate_names in current_settings.modeswitches) or
|
||||
not(sym.typ in [paravarsym,localvarsym]) then
|
||||
if not(m_duplicate_names in current_settings.modeswitches) then
|
||||
result:=inherited checkduplicate(hashedid,sym);
|
||||
end;
|
||||
end;
|
||||
@ -1168,10 +1168,7 @@ implementation
|
||||
if not is_funcret_sym(sym) and
|
||||
(defowner.typ=procdef) and
|
||||
assigned(tprocdef(defowner)._class) and
|
||||
(tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) and
|
||||
{ delphi allows local typed consts. having the same name as class members, probably
|
||||
a delphi bug, but some delphi code depends on it }
|
||||
not((m_duplicate_names in current_settings.modeswitches) and (sym.typ=staticvarsym)) then
|
||||
(tprocdef(defowner).owner.defowner=tprocdef(defowner)._class) then
|
||||
result:=tprocdef(defowner)._class.symtable.checkduplicate(hashedid,sym);
|
||||
end;
|
||||
|
||||
|
23
tests/webtbs/tw9176a.pp
Normal file
23
tests/webtbs/tw9176a.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{$mode delphi}
|
||||
|
||||
type TBla=class
|
||||
bla : integer;
|
||||
procedure Bla;
|
||||
procedure BlaBla;
|
||||
end;
|
||||
|
||||
procedure TBla.Bla;
|
||||
begin
|
||||
end;
|
||||
|
||||
procedure TBla.BlaBla;
|
||||
procedure Bla;
|
||||
begin
|
||||
end;
|
||||
begin
|
||||
Bla;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user