From cbd9f716c20f733f17a68c336d4ca4c9cd79291c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 28 Jan 2025 14:29:29 +0100 Subject: [PATCH] * Patch from Simone Tacconi to fix set getdeclaration. Fixes issue #41107 --- packages/fcl-passrc/src/pastree.pp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/fcl-passrc/src/pastree.pp b/packages/fcl-passrc/src/pastree.pp index b441995e09..7d5617bf89 100644 --- a/packages/fcl-passrc/src/pastree.pp +++ b/packages/fcl-passrc/src/pastree.pp @@ -4463,6 +4463,8 @@ begin end; function TPasArrayType.GetDeclaration (full : boolean) : TPasTreeString; +var + i : Integer; begin Result:='Array'; if Full then @@ -4473,12 +4475,23 @@ begin Result:=SafeName+' = '+Result; end; If (IndexRange<>'') then - Result:=Result+'['+IndexRange+']'; + Result:=Result+'['+IndexRange+']' + else if Length(Ranges)>0 then + begin + Result:=Result+'['; + for i:=0 to Length(Ranges)-1 do + begin + if i>0 then + Result:=Result+','; + Result:=Result+Ranges[i].GetDeclaration(True); + end; + Result:=Result+']'; + end; Result:=Result+' of '; If IsPacked then Result := 'packed '+Result; // 12/04/04 Dave - Added If Assigned(Eltype) then - Result:=Result+ElType.SafeName + Result:=Result+ElType.GetDeclaration(ElType is TPasUnresolvedTypeRef) else Result:=Result+'const'; end;