compiler: use anonymous inherited in all cases where the next token <> _ID (bug #0018443)

git-svn-id: trunk@16741 -
This commit is contained in:
paul 2011-01-09 05:08:04 +00:00
parent c0f6084c2e
commit 8f7ada0db0
3 changed files with 34 additions and 1 deletions

1
.gitattributes vendored
View File

@ -10945,6 +10945,7 @@ tests/webtbs/tw1820.pp svneol=native#text/plain
tests/webtbs/tw18222.pp svneol=native#text/pascal
tests/webtbs/tw1825.pp svneol=native#text/plain
tests/webtbs/tw18266.pp svneol=native#text/plain
tests/webtbs/tw18443.pp svneol=native#text/pascal
tests/webtbs/tw1850.pp svneol=native#text/plain
tests/webtbs/tw1851.pp svneol=native#text/plain
tests/webtbs/tw1856.pp svneol=native#text/plain

View File

@ -2383,7 +2383,7 @@ implementation
hclassdef:=hclassdef.childof;
{ if inherited; only then we need the method with
the same name }
if token in endtokens then
if token <> _ID then
begin
hs:=current_procinfo.procdef.procsym.name;
hsorg:=current_procinfo.procdef.procsym.realname;

32
tests/webtbs/tw18443.pp Normal file
View File

@ -0,0 +1,32 @@
program tw18433;
{$mode objfpc}
type
TBase = class
function Print: String; virtual;
end;
TDesc1 = class(TBase)
function Print: String; override;
end;
TDesc2 = class(TBase)
function Print: String; override;
end;
function TBase.Print: String;
begin
Result := 'Base';
end;
function TDesc1.Print: String;
begin
Result := inherited + '-Desc1';
end;
function TDesc2.Print: String;
begin
Result := inherited Print + '-Desc2';
end;
begin
end.