|
@@ -52,7 +52,7 @@ interface
|
|
{ generate persistent type information like VMT, RTTI and inittables }
|
|
{ generate persistent type information like VMT, RTTI and inittables }
|
|
procedure write_persistent_type_info(st:tsymtable);
|
|
procedure write_persistent_type_info(st:tsymtable);
|
|
|
|
|
|
- procedure generate_specialization(var tt:tdef;parse_class_parent:boolean);
|
|
|
|
|
|
+ procedure generate_specialization(var tt:tdef;parse_class_parent:boolean;_prettyname : string);
|
|
|
|
|
|
implementation
|
|
implementation
|
|
|
|
|
|
@@ -143,7 +143,7 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
- procedure generate_specialization(var tt:tdef;parse_class_parent:boolean);
|
|
|
|
|
|
+ procedure generate_specialization(var tt:tdef;parse_class_parent:boolean;_prettyname : string);
|
|
var
|
|
var
|
|
st : TSymtable;
|
|
st : TSymtable;
|
|
srsym : tsym;
|
|
srsym : tsym;
|
|
@@ -159,6 +159,7 @@ implementation
|
|
oldextendeddefs : TFPHashObjectList;
|
|
oldextendeddefs : TFPHashObjectList;
|
|
hmodule : tmodule;
|
|
hmodule : tmodule;
|
|
pu : tused_unit;
|
|
pu : tused_unit;
|
|
|
|
+ prettyname : ansistring;
|
|
uspecializename,
|
|
uspecializename,
|
|
specializename : string;
|
|
specializename : string;
|
|
vmtbuilder : TVMTBuilder;
|
|
vmtbuilder : TVMTBuilder;
|
|
@@ -228,6 +229,7 @@ implementation
|
|
if not assigned(genericdef.typesym) then
|
|
if not assigned(genericdef.typesym) then
|
|
internalerror(200710173);
|
|
internalerror(200710173);
|
|
specializename:=genericdef.typesym.realname;
|
|
specializename:=genericdef.typesym.realname;
|
|
|
|
+ prettyname:=genericdef.typesym.prettyname+'<';
|
|
for i:=0 to st.SymList.Count-1 do
|
|
for i:=0 to st.SymList.Count-1 do
|
|
begin
|
|
begin
|
|
sym:=tsym(st.SymList[i]);
|
|
sym:=tsym(st.SymList[i]);
|
|
@@ -247,7 +249,13 @@ implementation
|
|
if not assigned(pt2.resultdef.typesym) then
|
|
if not assigned(pt2.resultdef.typesym) then
|
|
message(type_e_generics_cannot_reference_itself)
|
|
message(type_e_generics_cannot_reference_itself)
|
|
else
|
|
else
|
|
- specializename:=specializename+'$'+pt2.resultdef.typesym.realname;
|
|
|
|
|
|
+ begin
|
|
|
|
+ specializename:=specializename+'$'+pt2.resultdef.typesym.realname;
|
|
|
|
+ if i=0 then
|
|
|
|
+ prettyname:=prettyname+pt2.resultdef.typesym.prettyname
|
|
|
|
+ else
|
|
|
|
+ prettyname:=prettyname+','+pt2.resultdef.typesym.prettyname;
|
|
|
|
+ end;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
@@ -257,6 +265,8 @@ implementation
|
|
pt2.free;
|
|
pt2.free;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ prettyname:=prettyname+'>';
|
|
|
|
+
|
|
uspecializename:=upper(specializename);
|
|
uspecializename:=upper(specializename);
|
|
{ force correct error location if too much type parameters are passed }
|
|
{ force correct error location if too much type parameters are passed }
|
|
if not (token in [_RSHARPBRACKET,_GT]) then
|
|
if not (token in [_RSHARPBRACKET,_GT]) then
|
|
@@ -335,6 +345,11 @@ implementation
|
|
ttypesym(srsym).typedef:=tt;
|
|
ttypesym(srsym).typedef:=tt;
|
|
tt.typesym:=srsym;
|
|
tt.typesym:=srsym;
|
|
|
|
|
|
|
|
+ if _prettyname<>'' then
|
|
|
|
+ ttypesym(tt.typesym).fprettyname:=_prettyname
|
|
|
|
+ else
|
|
|
|
+ ttypesym(tt.typesym).fprettyname:=prettyname;
|
|
|
|
+
|
|
case tt.typ of
|
|
case tt.typ of
|
|
{ Build VMT indexes for classes }
|
|
{ Build VMT indexes for classes }
|
|
objectdef:
|
|
objectdef:
|
|
@@ -616,7 +631,7 @@ implementation
|
|
(m_delphi in current_settings.modeswitches) then
|
|
(m_delphi in current_settings.modeswitches) then
|
|
dospecialize:=token=_LSHARPBRACKET;
|
|
dospecialize:=token=_LSHARPBRACKET;
|
|
if dospecialize then
|
|
if dospecialize then
|
|
- generate_specialization(def,stoParseClassParent in options)
|
|
|
|
|
|
+ generate_specialization(def,stoParseClassParent in options,'')
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
|
|
if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
|
|
@@ -1075,7 +1090,7 @@ implementation
|
|
if (m_delphi in current_settings.modeswitches) then
|
|
if (m_delphi in current_settings.modeswitches) then
|
|
dospecialize:=token=_LSHARPBRACKET;
|
|
dospecialize:=token=_LSHARPBRACKET;
|
|
if dospecialize then
|
|
if dospecialize then
|
|
- generate_specialization(def,false)
|
|
|
|
|
|
+ generate_specialization(def,false,name)
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
|
|
if assigned(current_specializedef) and (def=current_specializedef.genericdef) then
|