Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-10

type <id> = type <another id>; support

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Florian Klaempfl

In 1.1 I added proper support for the construct mentioned above. If you encounter problems, please inform me either using this mailing list or better via the bug reporting system.

Reply by email

Andrew Johnson

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

Reply by email