[fpc-devel]type <id> = type <another id>; support

Andrew Johnson acjgenius at earthlink.net
Sun Oct 20 05:46:51 CEST 2002


Well. I posted to the bug list already, but since I saw this message in 
the archives I figured I'd also post here. While trying to get lazarus 
to work with 1.1 I discovered that this type of declaration causes 
problems, specifically with TComponent's, it acts as though it 
redeclares the <another id>, as <id> which kills compiling. I noticed 
this specifically with longints, aka

type
   TNewInt = type longint;

   TNewClass = Class(TComponent)
   end;

would cause  the compiler to bomb out with

Compiling bugtest.pp
bugtest.pp(11,16) Error: overridden methods must have the same return 
type: "TObject.SafeCallException(TObject,Pointer) : LongInt" is 
overriden by "TComponent.SafeCallException(TObject,Pointer) : LongInt" 
which has another return type
bugtest.pp(16) Fatal: There were 1 errors compiling module, stopping

however doing

type
   TNewInt = type longint;
   TNewInt2 = longint;

   TNewClass = Class(TComponent)
   end;

would work fine(at least, it compiles without error).

Andrew





More information about the fpc-devel mailing list