Fix for Mantis #24953.

pgenutil.pas, parse_generic_parameters:
  * set the typesym of the newly created def so that inline specializations in pexpr.pas, sub_expr can check it correctly

git-svn-id: trunk@25410 -
This commit is contained in:
svenbarth 2013-09-04 12:56:08 +00:00
parent f11b8b5da4
commit d03507671d
3 changed files with 29 additions and 0 deletions

1
.gitattributes vendored
View File

@ -13512,6 +13512,7 @@ tests/webtbs/tw24865.pp svneol=native#text/pascal
tests/webtbs/tw24871.pp svneol=native#text/pascal
tests/webtbs/tw2492.pp svneol=native#text/plain
tests/webtbs/tw2494.pp svneol=native#text/plain
tests/webtbs/tw24953.pp svneol=native#text/pascal
tests/webtbs/tw2503.pp svneol=native#text/plain
tests/webtbs/tw2504.pp svneol=native#text/plain
tests/webtbs/tw2514.pp svneol=native#text/plain

View File

@ -1009,6 +1009,10 @@ uses
for i:=firstidx to result.count-1 do
ttypesym(result[i]).typedef:=basedef;
{ we need a typesym in case we do a Delphi-mode inline
specialization with this parameter; so just use the first sym }
if not assigned(basedef.typesym) then
basedef.typesym:=ttypesym(result[firstidx]);
firstidx:=result.count;
constraintdata.free;

24
tests/webtbs/tw24953.pp Normal file
View File

@ -0,0 +1,24 @@
unit tw24953;
interface
{$mode delphi}
Type
TPoolablePool<t:class,constructor> = class
factory : TObject;
constructor create;
end;
TPoolableFactory<t>= class
end;
implementation
{ TPoolablePool<t> }
constructor TPoolablePool<t>.create; // last line visible in -va output before crash
begin
factory:=TPoolableFactory<t>.create;
end;
end.