Sign in Join

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

Mailing lists / lazarus / 2010-04

Class autocompletion and abstract methods.

5 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Torsten Bonde Christiansen

Hi List.

When I use class auto-completion in Lazarus abstract methods are automatically generated in the implementation section and I believe this is a bug. Isn't the whole point of abstract methods to force implementation in descending classes and such abstractions should not be implemented in the base class.

Or is there some way of controlling this with options in Lazarus.

using:
Lazarus 0.9.29 r24627M FPC 2.4.0 x86_64-linux-gtk 2 (beta)

Kind regards,
Torsten Bonde Christiansen.

Reply by email

Mattias Gaertner
to Torsten Bonde Christiansen
Show quoted text 7 lines
Hi List. When I use class auto-completion in Lazarus abstract methods are automatically generated in the implementation section and I believe this is a bug. Isn't the whole point of abstract methods to force implementation in descending classes and such abstractions should not be implemented in the base class.

I just tested. It does not add. Do you have an example?

Or is there some way of controlling this with options in Lazarus. using: Lazarus 0.9.29 r24627M FPC 2.4.0 x86_64-linux-gtk 2 (beta)

Mattias

Reply by email

Torsten Bonde Christiansen
to Torsten Bonde Christiansen
Show quoted text 8 lines
Okay, that just me.... to many abstract methods cluttered it all and in between some methods were not properly name abstract as they should. Sorry for the inconvenience. Kind regards, Torsten Bonde Christiansen.

Got another question related to this - in a descendant class in redeclare (if that is the word for it) the methods naturally with the keyword 'override' for all.

Then using class completion here all created implemenations automatically creates the line "inherited <methodname>" which is not legal Free Pascal syntax, at least it give me a compile time error.

Is this not a bug then - i will assume it's not the intent of Lazarus to create autocompletion code that does not compile?

Kind regards,
Torsten Bonde Christiansen.

Reply by email

Mattias Gaertner
to Torsten Bonde Christiansen
Show quoted text 17 lines
> > Okay, that just me.... to many abstract methods cluttered it all and > in between some methods were not properly name abstract as they should. > > Sorry for the inconvenience. > > Kind regards, > Torsten Bonde Christiansen. Got another question related to this - in a descendant class in redeclare (if that is the word for it) the methods naturally with the keyword 'override' for all. Then using class completion here all created implemenations automatically creates the line "inherited <methodname>" which is not legal Free Pascal syntax, at least it give me a compile time error.

It creates "inherited methodname(params);".

It is not legal to call abstract methods, but the class completion does not check this yet. There is already a feature request for that.

Is this not a bug then - i will assume it's not the intent of Lazarus to create autocompletion code that does not compile?

Good guess.

Mattias

Reply by email