mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-25 15:09:22 +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)
|
TPasType = class(TPasElement)
|
||||||
Protected
|
Protected
|
||||||
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString;
|
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString; virtual;
|
||||||
public
|
public
|
||||||
Function SafeName : TPasTreeString; override;
|
Function SafeName : TPasTreeString; override;
|
||||||
function ElementTypeName: TPasTreeString; override;
|
function ElementTypeName: TPasTreeString; override;
|
||||||
@ -551,6 +551,8 @@ type
|
|||||||
{ TPasAliasType }
|
{ TPasAliasType }
|
||||||
|
|
||||||
TPasAliasType = class(TPasType)
|
TPasAliasType = class(TPasType)
|
||||||
|
protected
|
||||||
|
Function FixTypeDecl(aDecl: TPasTreeString) : TPasTreeString; override;
|
||||||
public
|
public
|
||||||
procedure FreeChildren(Prepare: boolean); override;
|
procedure FreeChildren(Prepare: boolean); override;
|
||||||
function ElementTypeName: TPasTreeString; override;
|
function ElementTypeName: TPasTreeString; override;
|
||||||
@ -3372,6 +3374,19 @@ begin
|
|||||||
inherited FreeChildren(Prepare);
|
inherited FreeChildren(Prepare);
|
||||||
end;
|
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);
|
procedure TPasAliasType.FreeChildren(Prepare: boolean);
|
||||||
begin
|
begin
|
||||||
SubType:=TPasType(FreeChild(SubType,Prepare));
|
SubType:=TPasType(FreeChild(SubType,Prepare));
|
||||||
|
Loading…
Reference in New Issue
Block a user