mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 22:47:59 +02:00
* Patch from Simone Tacconi to fix alias type getdeclaration. Fixes issue #41109
This commit is contained in:
parent
cbd9f716c2
commit
b97ace9168
@ -541,7 +541,7 @@ type
|
||||
|
||||
TPasType = class(TPasElement)
|
||||
Protected
|
||||
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString;
|
||||
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString; virtual;
|
||||
public
|
||||
Function SafeName : TPasTreeString; override;
|
||||
function ElementTypeName: TPasTreeString; override;
|
||||
@ -551,6 +551,8 @@ type
|
||||
{ TPasAliasType }
|
||||
|
||||
TPasAliasType = class(TPasType)
|
||||
protected
|
||||
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString; override;
|
||||
public
|
||||
procedure FreeChildren(Prepare: boolean); override;
|
||||
function ElementTypeName: TPasTreeString; override;
|
||||
@ -3372,6 +3374,19 @@ begin
|
||||
inherited FreeChildren(Prepare);
|
||||
end;
|
||||
|
||||
function TPasAliasType.FixTypeDecl(aDecl: TPasTreeString): TPasTreeString;
|
||||
|
||||
var
|
||||
PasType : TPasType;
|
||||
begin
|
||||
Result:=aDecl;
|
||||
PasType:=TPasTypeAliasType(Self).DestType;
|
||||
Result:='type '+PasType.GetDeclaration(PasType is TPasUnresolvedTypeRef);
|
||||
if (Name<>'') then
|
||||
Result:=SafeName+' = '+Result;
|
||||
ProcessHints(false,Result);
|
||||
end;
|
||||
|
||||
procedure TPasAliasType.FreeChildren(Prepare: boolean);
|
||||
begin
|
||||
SubType:=TPasType(FreeChild(SubType,Prepare));
|
||||
|
Loading…
Reference in New Issue
Block a user