[fpc-devel] Warning: Constructor should be public

Graeme Geldenhuys graemeg.lists at gmail.com
Tue Apr 7 00:15:52 CEST 2009


2009/4/6 Flávio Etrusco <flavio.etrusco at gmail.com>:
> Actually, your constructor has the same signature as 'TObject.Create',
> so it should show a 'lower visibility' warning in Delphi, doesn't it?

Correct, Delphi should also give this warning.

> But, indeed, FPC shows the warning (should be public) for all
> constructors, even if you're not hiding from the parent class, and I
> always found this a (minor) annoyance.

See my previous reply. Lowering visibility in descendant classes are
breaking a contract (class interface) that was previously declared.


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list