HomeDelphiDelphi Error – E2133 TYPEINFO standard function expects a type identifier

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 X2421 Imported identifier ‘%s’ conflicts with ‘%s’ in ‘%s’ Reason for the Error & Solution This occurs...
Delphi Compiler Error X2367 Case of property accessor method %s.%s should be %s.%s Reason for the Error & Solution No...
Delphi Compiler Error X2269 Overriding virtual method ‘%s.%s’ has lower visibility (%s) than base class ‘%s’ (%s) Reason for the...