mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-02 18:30:33 +02:00
* fix for Mantis #22192: handle the case that a specialization has the same name as the generic it's based on as in that case the typedef of the symbol is an errordef; therefor we need to use the symbol's real name
+ added test git-svn-id: trunk@34530 -
This commit is contained in:
parent
fd7daf91df
commit
50f2aab0ef
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14740,6 +14740,7 @@ tests/webtbs/tw22154.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw22155.pp svneol=native#text/plain
|
tests/webtbs/tw22155.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw22160a1.pp svneol=native#text/pascal
|
tests/webtbs/tw22160a1.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw22160b1.pp svneol=native#text/pascal
|
tests/webtbs/tw22160b1.pp svneol=native#text/pascal
|
||||||
|
tests/webtbs/tw22192.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw2220.pp svneol=native#text/plain
|
tests/webtbs/tw2220.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw22225.pp svneol=native#text/pascal
|
tests/webtbs/tw22225.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw2226.pp svneol=native#text/plain
|
tests/webtbs/tw2226.pp svneol=native#text/plain
|
||||||
|
@ -1409,6 +1409,7 @@ implementation
|
|||||||
function handle_specialize_inline_specialization(var srsym:tsym;out srsymtable:tsymtable;out spezcontext:tspecializationcontext):boolean;
|
function handle_specialize_inline_specialization(var srsym:tsym;out srsymtable:tsymtable;out spezcontext:tspecializationcontext):boolean;
|
||||||
var
|
var
|
||||||
spezdef : tdef;
|
spezdef : tdef;
|
||||||
|
symname : tsymstr;
|
||||||
begin
|
begin
|
||||||
result:=false;
|
result:=false;
|
||||||
spezcontext:=nil;
|
spezcontext:=nil;
|
||||||
@ -1424,7 +1425,11 @@ implementation
|
|||||||
spezdef:=ttypesym(srsym).typedef
|
spezdef:=ttypesym(srsym).typedef
|
||||||
else
|
else
|
||||||
spezdef:=tdef(tprocsym(srsym).procdeflist[0]);
|
spezdef:=tdef(tprocsym(srsym).procdeflist[0]);
|
||||||
spezdef:=generate_specialization_phase1(spezcontext,spezdef);
|
if (spezdef.typ=errordef) and (sp_generic_dummy in srsym.symoptions) then
|
||||||
|
symname:=srsym.RealName
|
||||||
|
else
|
||||||
|
symname:='';
|
||||||
|
spezdef:=generate_specialization_phase1(spezcontext,spezdef,symname);
|
||||||
case spezdef.typ of
|
case spezdef.typ of
|
||||||
errordef:
|
errordef:
|
||||||
begin
|
begin
|
||||||
|
10
tests/webtbs/tw22192.pp
Normal file
10
tests/webtbs/tw22192.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %NORUN }
|
||||||
|
|
||||||
|
{$MODE DELPHI}
|
||||||
|
|
||||||
|
type
|
||||||
|
TWrapper<T> = record end;
|
||||||
|
TWrapper = TWrapper<Byte>;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user