diff --git a/packages/fcl-passrc/src/paswrite.pp b/packages/fcl-passrc/src/paswrite.pp index 448413e9cd..671a164817 100644 --- a/packages/fcl-passrc/src/paswrite.pp +++ b/packages/fcl-passrc/src/paswrite.pp @@ -150,7 +150,8 @@ end; procedure TPasWriter.WriteType(AType: TPasType); begin - PrepareDeclSection('type'); + if AType.Parent is TPasSection then + PrepareDeclSection('type'); if AType.ClassType = TPasUnresolvedTypeRef then wrt(AType.Name) else if AType.ClassType = TPasClassType then