Delphi Error – E2075 This form of method call only allowed in methods of derived types

Delphi Compiler Error

E2075 This form of method call only allowed in methods of derived types

Reason for the Error & Solution

This error message is issued if you try to make a call to a method of an ancestor type, but you are in fact not in a method.

program Produce;

type
  TMyClass = class
    constructor Create;
  end;

procedure Create;
begin
  inherited Create;      (*<-- Error message here*)
end;

begin
end.

The example tries to call an inherited constructor in procedure Create, which is not a method.

program Solve;

type
  TMyClass = class
    constructor Create;
  end;

constructor TMyclass.Create;
begin
  inherited Create;
end;

begin
end.

The solution is to make sure you are in fact in a method when using this form of call.

Share:

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Delphi Compiler Error E2313 Attribute – Known attribute cannot specify properties Reason for the Error & Solution No further information...
Delphi Compiler Error E2379 Virtual methods not allowed in record types Reason for the Error & Solution No further information...
Rodrigo , one of the long time Delphi Developer has been working on one of his personal project “Delphi IDE...