[Lazarus] Code completion question

Ondrej Pokorny lazarus at kluug.net
Tue Jan 26 23:39:28 CET 2016


On 26.01.2016 23:12, Vojtěch Čihák wrote:
> It is a bug? I know this behaviour for a long time and I always 
> believed it is by design.

I also came across it and it confused me for a second as well. Then I 
realized my mistake.

But anyway, you can do it and the code compiles, so CodeTools should 
allow it. During the compilation you get a hint about "overriden method 
has lower visibility [...]", if I remember correctly.

So yes, to avoid confusion I would say the visibility filter is 
unnecessarily restrictive.


+ What bugs me even more is that protected methods are not available 
with the inherited keyword:

procedure TMyClass2.Foo;
begin
   inherited Proc // CodeTools do not list Proc that is in protected 
section of parent class from different unit. It works without the 
"inherited" keyword, though
end;

I have to check why.

Ondrej




More information about the Lazarus mailing list