mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 18:51:31 +02:00
compiler: use anonymous inherited in all cases where the next token <> _ID (bug #0018443)
git-svn-id: trunk@16741 -
This commit is contained in:
parent
c0f6084c2e
commit
8f7ada0db0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
32
tests/webtbs/tw18443.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user