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

leledumbo leledumbo_cool at yahoo.co.id
Sun Mar 6 19:20:12 CET 2011


Maybe for the programmer of the unit, but for the users, it's almost always a
disadvantage. They will get unexpected behavior instead (especially if you
put it along with other things in the unit where one might need some of
them). Open LCL sources and see how its components are named. For your
"advantage" case, I would give something like TColorEdit. Your proposal has
an advantage of changing a component behavior just by changing the uses
clause, that's also possible with the current situation. Example:

uses
  StdCtrls,ColorEdit;

type
  TEditCtrl = TEdit;

... // use TEditCtrl everywhere

when you want to change to TColorEdit, just change TEditCtrl definition to
TColorEdit. Same type-savings as your proposal.

--
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-Code-completion-Error-ancestor-has-same-name-as-class-tp2640414p2642585.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.




More information about the Lazarus mailing list