mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 15:49:26 +02:00
Contrary to popular believe the VMT for a generic needs to be at least generated so that check for inherited methods can be done correctly. This does however not mean that the VMT is written to the object file which is handled at a completely different place. Fixes Mantis #26193.
pdecl.pas, types_dec: * invoke the VMT builder for generic classes as well + added test git-svn-id: trunk@27869 -
This commit is contained in:
parent
79d2abd1ca
commit
9ab5affd55
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12747,6 +12747,7 @@ tests/webtbf/tw25861.pp svneol=native#text/plain
|
||||
tests/webtbf/tw25862.pp svneol=native#text/plain
|
||||
tests/webtbf/tw25915.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw25951.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw26193.pp svneol=native#text/pascal
|
||||
tests/webtbf/tw2657.pp svneol=native#text/plain
|
||||
tests/webtbf/tw2670.pp svneol=native#text/plain
|
||||
tests/webtbf/tw2719.pp svneol=native#text/plain
|
||||
|
@ -798,8 +798,7 @@ implementation
|
||||
|
||||
{ Build VMT indexes, skip for type renaming and forward classes }
|
||||
if (hdef.typesym=newtype) and
|
||||
not(oo_is_forward in tobjectdef(hdef).objectoptions) and
|
||||
not(df_generic in hdef.defoptions) then
|
||||
not(oo_is_forward in tobjectdef(hdef).objectoptions) then
|
||||
begin
|
||||
vmtbuilder:=TVMTBuilder.Create(tobjectdef(hdef));
|
||||
vmtbuilder.generate_vmt;
|
||||
|
23
tests/webtbf/tw26193.pp
Normal file
23
tests/webtbf/tw26193.pp
Normal file
@ -0,0 +1,23 @@
|
||||
{ %FAIL }
|
||||
|
||||
program tw26193;
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
type
|
||||
TA<T> = class
|
||||
function Foo: Boolean; virtual; abstract;
|
||||
end;
|
||||
|
||||
TB<T> = class(TA<byte>)
|
||||
// Missing (!) error: There is no method in an ancestor class to be overridden: "Foo;"
|
||||
procedure Foo; override;
|
||||
end;
|
||||
|
||||
procedure TB<T>.Foo;
|
||||
begin
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user