Skip to content

Do not allow to use type alias for method implementations in objfpc mode.

Currently the compiler allows to use type aliases to implement a method.

type
  TBird = class
    procedure Fly;
  end;
  TEagle = TBird; // alias

procedure TEagle.Fly;
begin
end;

or even

Interface

Type
   TSomeReallyAnnoyingIncrediblyLongClassName = Class
   Type
      TSomeReallyAnnoyingSubClass = class
         Procedure DoSomething;
      end;
   end;

implementation

Type
   T1 = TSomeReallyAnnoyingIncrediblyLongClassName.TSomeReallyAnnoyingSubClass;

procedure T1.DoSomething;

begin
end;

Delphi allows to parse this, so it should be allowed in mode delphi, but in mode objfpc this use of type aliases should be forbidden.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information