mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-24 20:31:03 +02:00
pastojs: override specialize name
git-svn-id: trunk@46787 -
(cherry picked from commit 43aa4c6b40
)
This commit is contained in:
parent
cf57cce1d3
commit
7b2d84ab42
@ -1512,6 +1512,7 @@ type
|
||||
function GenerateGUID(El: TPasClassType): string; virtual;
|
||||
protected
|
||||
// generic/specialize
|
||||
function CreateSpecializedTypeName(Item: TPRSpecializedItem): string; override;
|
||||
procedure SpecializeGenericIntf(SpecializedItem: TPRSpecializedItem);
|
||||
override;
|
||||
procedure SpecializeGenericImpl(SpecializedItem: TPRSpecializedItem);
|
||||
@ -4976,6 +4977,11 @@ begin
|
||||
Result:=Result+'}';
|
||||
end;
|
||||
|
||||
function TPas2JSResolver.CreateSpecializedTypeName(Item: TPRSpecializedItem): string;
|
||||
begin
|
||||
Result:=Item.GenericEl.Name+'$G'+IntToStr(Item.Index+1);
|
||||
end;
|
||||
|
||||
procedure TPas2JSResolver.SpecializeGenericIntf(
|
||||
SpecializedItem: TPRSpecializedItem);
|
||||
{$IFDEF EnableLongNames}
|
||||
|
@ -870,7 +870,7 @@ begin
|
||||
LinesToStr([ // $mod.$main
|
||||
'$mod.w = $mod.c;',
|
||||
'']));
|
||||
CheckHint(mtWarning,nClassTypesAreNotRelatedXY,'Class types "TBird$G2<Char>" and "TBird$G1<Word>" are not related');
|
||||
CheckHint(mtWarning,nClassTypesAreNotRelatedXY,'Class types "TBird$G2" and "TBird$G1" are not related');
|
||||
CheckResolverUnexpectedHints();
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user