[Lazarus] Code completion: Error: ancestor has same name as class.

Mattias Gaertner nc-gaertnma at netcologne.de
Sun Mar 6 08:47:49 CET 2011


On Sat, 5 Mar 2011 22:57:02 -0300
Marcos Douglas <md at delfire.net> wrote:

> The program below compiles. But if I try to use code completion here
> writeln(s.F...
> Occurs this error:
> test.lpr(8,31) Error: ancestor has same name as class.
> 
> program test;
> 
> {$mode objfpc}{$H+}
> 
> uses SysUtils, Classes;
> 
> type
>   TStringList = class(Classes.TStringList)

The codetools have no circle detection when searching
recursively. As a simple protection versus endless loops they do not
support naming classes the same as their ancestort.
And I agree with Juha, it is bad coding practice.

Mattias




More information about the Lazarus mailing list