Show: Object Pascal C++
Display Preferences

E2075 This form of method call only allowed in methods of derived types (Object Pascal)

From Appmethod Topics
Jump to: navigation, search

Go Up to Error and Warning Messages (Object Pascal) Index

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.

Personal tools
In other languages