Delphi Error – E2019 Object type required

Delphi Compiler Error

E2019 Object type required

Reason for the Error & Solution

This error is given whenever an object type is expected by the compiler. For instance, the ancestor type of an object must also be an object type.

type
  MyObject = object(TObject)
  end;
begin
end.

Confusingly enough, TObject in the unit System has a class type, so we cannot derive an object type from it.

program Solve;
type
  MyObject = class  (*Actually, this means: class(TObject)*)
  end;
begin
end.

Make sure the type identifier really stands for an object type – maybe it is misspelled, or maybe is hidden by an identifier from another unit.

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...