Fix for Mantis #27424.

pgenutil.pas:
  * parse_generic_parameters: a ';' terminates a parameter group, so correctly adjust firstidx in that case

+ added test

git-svn-id: trunk@29685 -
This commit is contained in:
svenbarth 2015-02-13 13:50:47 +00:00
parent 8e2f8d7f3c
commit 04534d5dcf
3 changed files with 28 additions and 1 deletions

1
.gitattributes vendored
View File

@ -14249,6 +14249,7 @@ tests/webtbs/tw2736.pp svneol=native#text/plain
tests/webtbs/tw2737.pp svneol=native#text/plain
tests/webtbs/tw2738.pp svneol=native#text/plain
tests/webtbs/tw2739.pp svneol=native#text/plain
tests/webtbs/tw27424.pp svneol=native#text/pascal
tests/webtbs/tw2758.pp svneol=native#text/plain
tests/webtbs/tw2763.pp svneol=native#text/plain
tests/webtbs/tw2765.pp svneol=native#text/plain

View File

@ -1130,7 +1130,11 @@ uses
firstidx:=result.count;
constraintdata.free;
end;
end
else
if token=_SEMICOLON then
{ a semicolon terminates a type parameter group }
firstidx:=result.count;
until not (try_to_consume(_COMMA) or try_to_consume(_SEMICOLON));
block_type:=old_block_type;
end;

22
tests/webtbs/tw27424.pp Normal file
View File

@ -0,0 +1,22 @@
{ %NORUN }
program tw27424;
{$mode objfpc}
type
TType = class(TObject)
end;
generic TTest<T1; T2: TType> = class(TObject)
end;
TFoo = class(TType)
end;
TBar = class(specialize TTest<string, TFoo>)
end;
begin
end.