[fpc-devel] is that intended? private type section in classes versus visibility

Paul Ishenin ip at kmiac.ru
Fri Jul 23 03:46:49 CEST 2010


23.07.2010 9:20, Paul Ishenin wrote:
>> Is that intended? Or should a visibility change exit the type section?
>
> This is a bug. I will fix it.

What to do with the generics syntax? FPC do this so:

   generic TFPGList<T> = class(TFPSList)
   type public
     TCompareFunc = function(const Item1, Item2: T): Integer;
   var protected
     FOnCompare: TCompareFunc;
     function  ItemPtrCompare(Item1, Item2: Pointer): Integer;
   public
     constructor Create;
   end;

while Delphi do so:

   TSomeClass = class
   public
    type
      TCompareFunc = function(const Item1, Item2: T): Integer;
    protected
     var
      FOnCompare: TCompareFunc;
     function  ItemPtrCompare(Item1, Item2: Pointer): Integer;
   public
     constructor Create;
   end;

Therefore section declarations are incompatible between fpc and delphi. 
Should this be {$mode} dependent?

Best regards,
Paul Ishenin.




More information about the fpc-devel mailing list