RAD Studio Athens

H2440

Go Up to Error and Warning Messages (Delphi)

A member that is accessed within the body of an inline method must be accessible anywhere that the inline method is called. Therefore, the member must be at least as visible as the inline method.

Here is an example of code that will raise this error:


type
   TFoo = class
   private
     PrivateMember: Integer;
   public
     function PublicFunc:Integer; inline;
   end;

function TFoo.PublicFunc:Integer;
	begin
		Resultย := Self.PrivateMember;
	end;

Because Resultย := Self.PrivateMember; will be inserted wherever PublicFunc is called, PrivateMember must be accessible in any such location.

To correct this error, remove the inline directive or adjust the visibility of the inline method or the member it accesses.