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:
svenbarth 2014-06-06 15:19:45 +00:00
parent 381cf72023
commit 49a9f4c1ea
3 changed files with 28 additions and 2 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.