[fpc-pascal] TypInfo Error: type identifier not allowed here

Graeme Geldenhuys graemeg.lists at gmail.com
Fri Oct 27 10:17:02 CEST 2006


Why do I get this error?
/tiOPF/UnitTests/Common/tiDUnitUtils.pas(231,32) Error: type
identifier not allowed here

It works on other enumerated declarations, but not on this one.  I am
pretty sure this code worked before, as I have been using tiOPF under
FPC since December 2005.  I marked the location of the error with a
comment in the code below.


procedure TtiTestCase.CheckObjectState(
  pObjectState: TPerObjectState;
  pData: TtiObject;
  const pMessage: string = '');
begin
  Assert(pData.TestValid, cTIInvalidObjectError);
  Check(pObjectState = pData.ObjectState,
          'ObjectState: Expected <' +
          GetEnumName(TypeInfo(TPerObjectState), Ord(pObjectState)) +
//  error occurs here               ---^---
          '> but got <' +
          pData.ObjectStateAsString +
          '> on ' + pData.ClassName + '. ' + pMessage);
end;


where TPerObjectState is declared as follows:

  TPerObjectState = (
                      posEmpty,
                      posPK,
                      posCreate,
                      posUpdate,
                      posDelete,
                      posDeleted,
                      posClean
                     ) ;


I am using FPC 2.1.1 (r4642) under Linux (kernel 2.6) on Intel P4 processor.

Regards,
  - Graeme -


-- 
There's no place like 127.0.0.1



More information about the fpc-pascal mailing list