diff --git a/.gitattributes b/.gitattributes index 90094d6e30..6779241903 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/pgenutil.pas b/compiler/pgenutil.pas index 225b2fedc8..af6f34ba94 100644 --- a/compiler/pgenutil.pas +++ b/compiler/pgenutil.pas @@ -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; diff --git a/tests/webtbs/tw24953.pp b/tests/webtbs/tw24953.pp new file mode 100644 index 0000000000..ec9eaa49d7 --- /dev/null +++ b/tests/webtbs/tw24953.pp @@ -0,0 +1,24 @@ +unit tw24953; + +interface +{$mode delphi} + +Type + TPoolablePool = class + factory : TObject; + constructor create; + end; + + TPoolableFactory= class + end; + +implementation + +{ TPoolablePool } + +constructor TPoolablePool.create; // last line visible in -va output before crash +begin + factory:=TPoolableFactory.create; +end; + +end.