diff --git a/.gitattributes b/.gitattributes index 6bdbc5e5cc..8881c507a4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -14740,6 +14740,7 @@ tests/webtbs/tw22154.pp svneol=native#text/pascal tests/webtbs/tw22155.pp svneol=native#text/plain tests/webtbs/tw22160a1.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/tw22225.pp svneol=native#text/pascal tests/webtbs/tw2226.pp svneol=native#text/plain diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 006d7e49c0..043c0fc4e5 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -1409,6 +1409,7 @@ implementation function handle_specialize_inline_specialization(var srsym:tsym;out srsymtable:tsymtable;out spezcontext:tspecializationcontext):boolean; var spezdef : tdef; + symname : tsymstr; begin result:=false; spezcontext:=nil; @@ -1424,7 +1425,11 @@ implementation spezdef:=ttypesym(srsym).typedef else 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 errordef: begin diff --git a/tests/webtbs/tw22192.pp b/tests/webtbs/tw22192.pp new file mode 100644 index 0000000000..2a268c94f7 --- /dev/null +++ b/tests/webtbs/tw22192.pp @@ -0,0 +1,10 @@ +{ %NORUN } + +{$MODE DELPHI} + + type + TWrapper = record end; + TWrapper = TWrapper; + + begin + end.