mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 04:39:34 +02:00
Fix for Mantis #26123.
pdecobj.pas, object_dec: * Always check for genericdef and genericlist and not genericdef and ifnot then genericlist. + added test git-svn-id: trunk@27877 -
This commit is contained in:
parent
381cf72023
commit
49a9f4c1ea
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -13938,6 +13938,7 @@ tests/webtbs/tw25956.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw25959.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2602.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2607.pp svneol=native#text/plain
|
||||
tests/webtbs/tw26123.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw26162.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw26180.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw2620.pp svneol=native#text/plain
|
||||
|
@ -1397,9 +1397,9 @@ implementation
|
||||
|
||||
{ usage of specialized type inside its generic template }
|
||||
if assigned(genericdef) then
|
||||
current_specializedef:=current_structdef
|
||||
current_specializedef:=current_structdef;
|
||||
{ reject declaration of generic class inside generic class }
|
||||
else if assigned(genericlist) then
|
||||
if assigned(genericlist) then
|
||||
current_genericdef:=current_structdef;
|
||||
|
||||
{ nested types of specializations are specializations as well }
|
||||
|
25
tests/webtbs/tw26123.pp
Normal file
25
tests/webtbs/tw26123.pp
Normal file
@ -0,0 +1,25 @@
|
||||
{ %NORUN }
|
||||
|
||||
program tw26123;
|
||||
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
generic TNode<data_type> = class // anything can go in this class
|
||||
end;
|
||||
|
||||
generic TLinkedList<data_type> = class
|
||||
type
|
||||
specialized_TNode = specialize TNode<data_type>;
|
||||
public
|
||||
node : specialized_TNode;
|
||||
end;
|
||||
|
||||
|
||||
generic TExtendedLinkedList<data_type> = class (specialize TLinkedList<data_type>)
|
||||
public
|
||||
last_node : specialized_TNode;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user