From 33c1e3e53715836b22d95702a7d1ece9d0c21c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 28 Jan 2025 14:48:10 +0100 Subject: [PATCH] * Patch from Simone Tacconi to fix alias type getdeclaration. Fixes issue #41115 --- packages/fcl-passrc/src/paswrite.pp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/fcl-passrc/src/paswrite.pp b/packages/fcl-passrc/src/paswrite.pp index ee053f331b..26ba1e55fd 100644 --- a/packages/fcl-passrc/src/paswrite.pp +++ b/packages/fcl-passrc/src/paswrite.pp @@ -891,6 +891,18 @@ begin IncIndent; IncDeclSectionLevel; WriteMembers(AType.Members,visPublic); + if AType.Variants<>nil then + begin + temp:='case '; + if (AType.VariantEl is TPasVariable) then + temp:=Temp+AType.VariantEl.Name+' : '+TPasVariable(AType.VariantEl).VarType.Name + else if (AType.VariantEl<>Nil) then + temp:=temp+AType.VariantEl.Name; + temp:=temp+' of'; + AddLn(Temp); + For I:=0 to AType.Variants.Count-1 do + AddLn(TPasVariant(AType.Variants[i]).GetDeclaration(True)); + end; DecDeclSectionLevel; DecIndent; Add('end');