mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 23:40:14 +02:00
* fix #39795: when extracting make_prettystring it was forgotten to also append the const part of the name to the specialize name
This commit is contained in:
parent
45415f0645
commit
b2a5334a75
@ -101,6 +101,8 @@ uses
|
|||||||
if not assigned(module) then
|
if not assigned(module) then
|
||||||
internalerror(2016112802);
|
internalerror(2016112802);
|
||||||
namepart:='_$'+hexstr(module.moduleid,8)+'$$'+paramtype.unique_id_str;
|
namepart:='_$'+hexstr(module.moduleid,8)+'$$'+paramtype.unique_id_str;
|
||||||
|
if constprettyname<>'' then
|
||||||
|
namepart:=namepart+'$$'+constprettyname;
|
||||||
{ 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
|
(symtablestack.top.defowner.typ=procdef) and
|
||||||
|
18
tests/webtbs/tw39795.pp
Normal file
18
tests/webtbs/tw39795.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
program tw39795;
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
type
|
||||||
|
generic GTestType<T,const S:byte>=class
|
||||||
|
type
|
||||||
|
TXX=array [0..S] of T;
|
||||||
|
var
|
||||||
|
XX:TXX;
|
||||||
|
end;
|
||||||
|
T2=specialize GTestType<byte,0>;
|
||||||
|
T3=specialize GTestType<byte,99>;
|
||||||
|
begin
|
||||||
|
if sizeof(T2.TXX) <> 1 then
|
||||||
|
Halt(1);
|
||||||
|
if sizeof(T3.TXX) <> 100 then
|
||||||
|
Halt(2);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user