Delphi Error – E2133 TYPEINFO standard function expects a type identifier

Delphi Compiler Error

E2133 TYPEINFO standard function expects a type identifier

Reason for the Error & Solution

You have attempted to obtain type information for an identifier which does not represent a type.

program Produce;

  var
    p : Pointer;

  procedure NotType;
  begin
  end;


begin
  p := TypeInfo(NotType);
end.

The TypeInfo standard procedure requires a type identifier as it’s parameter. In the code above, ‘NotType’ does not represent a type identifier.

program Solve;

  type
    Base = class
    end;

  var
    p : Pointer;

begin
  p := TypeInfo(Base);
end.

By ensuring that the parameter used for TypeInfo is a type identifier, you will avoid this error.

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