mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-10 12:09:24 +01:00
Fix for Mantis #30030.
pgenutil.pas: * parse_generic_specialization_types_internal: ignore the parasymtable of procvars (as before the addition of generic routines) and instead use the type's hierarchy name * generate_specialization_phase2: specialize types of procvars into the parameter symtable as they don't have a local one + added test git-svn-id: trunk@33544 -
This commit is contained in:
parent
bae53fda21
commit
d07b49270f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -15013,6 +15013,7 @@ tests/webtbs/tw29958.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw2998.pp svneol=native#text/plain
|
tests/webtbs/tw2998.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2999.pp svneol=native#text/plain
|
tests/webtbs/tw2999.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw29992.pp svneol=native#text/plain
|
tests/webtbs/tw29992.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw30030.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw30035.pp svneol=native#text/plain
|
tests/webtbs/tw30035.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw30035a.pp svneol=native#text/plain
|
tests/webtbs/tw30035a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw3004.pp svneol=native#text/plain
|
tests/webtbs/tw3004.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -349,11 +349,10 @@ uses
|
|||||||
begin
|
begin
|
||||||
{ we use the full name of the type to uniquely identify it }
|
{ we use the full name of the type to uniquely identify it }
|
||||||
if (symtablestack.top.symtabletype=parasymtable) and
|
if (symtablestack.top.symtabletype=parasymtable) and
|
||||||
|
(symtablestack.top.defowner.typ=procdef) and
|
||||||
(typeparam.resultdef.owner=symtablestack.top) then
|
(typeparam.resultdef.owner=symtablestack.top) then
|
||||||
begin
|
begin
|
||||||
{ special handling for specializations inside generic function declarations }
|
{ special handling for specializations inside generic function declarations }
|
||||||
if symtablestack.top.defowner.typ<>procdef then
|
|
||||||
internalerror(2015080101);
|
|
||||||
namepart:=tdef(symtablestack.top.defowner).unique_id_str;
|
namepart:=tdef(symtablestack.top.defowner).unique_id_str;
|
||||||
namepart:='genproc'+namepart+'_'+tdef(symtablestack.top.defowner).fullownerhierarchyname+'_'+tprocdef(symtablestack.top.defowner).procsym.realname+'_'+typeparam.resultdef.typename;
|
namepart:='genproc'+namepart+'_'+tdef(symtablestack.top.defowner).fullownerhierarchyname+'_'+tprocdef(symtablestack.top.defowner).procsym.realname+'_'+typeparam.resultdef.typename;
|
||||||
prettynamepart:=tdef(symtablestack.top.defowner).fullownerhierarchyname+tprocdef(symtablestack.top.defowner).procsym.prettyname;
|
prettynamepart:=tdef(symtablestack.top.defowner).fullownerhierarchyname+tprocdef(symtablestack.top.defowner).procsym.prettyname;
|
||||||
@ -795,7 +794,8 @@ uses
|
|||||||
{ we specialize the partial specialization into the symtable of the currently parsed
|
{ we specialize the partial specialization into the symtable of the currently parsed
|
||||||
generic }
|
generic }
|
||||||
case current_genericdef.typ of
|
case current_genericdef.typ of
|
||||||
procvardef,
|
procvardef:
|
||||||
|
specializest:=current_genericdef.getsymtable(gs_para);
|
||||||
procdef:
|
procdef:
|
||||||
specializest:=current_genericdef.getsymtable(gs_local);
|
specializest:=current_genericdef.getsymtable(gs_local);
|
||||||
objectdef,
|
objectdef,
|
||||||
|
|||||||
15
tests/webtbs/tw30030.pp
Normal file
15
tests/webtbs/tw30030.pp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
|
||||||
|
program tw30030;
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
type
|
||||||
|
TAcl<K, R, M> = Class
|
||||||
|
End;
|
||||||
|
|
||||||
|
TAssertion<K, R, M> = Function(Acl: TAcl<K, R, M>): Boolean Of Object;
|
||||||
|
|
||||||
|
begin
|
||||||
|
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user