[fpc-pascal] Compiler Warning: Constructor should be public
Anthony Walter
sysrpl at gmail.com
Tue Nov 10 15:07:44 CET 2009
Your argument is flawed. Visibility rules apply to identifiers, not keywords.
Create // identifier
CreateFromLine // different identifier
No visibility is being changed by introducing a *new* identifier
raise EAssertError.Create(Msg); // still visible
raise EAssertError.CreateFromLine(Msg, FileName, LineNumber); // not visible
On Tue, Nov 10, 2009 at 8:56 AM, Graeme Geldenhuys
<graeme at mastermaths.co.za> wrote:
>
> Anthony Walter wrote:
> >
> > In my opinion the warning should be removed, or at least able to be
> > suppress through a switch. I beginning to make the transition to cross
>
> The compiler is 100% and I think it should actually raise an Error
> instead of a Warning.
>
> Your code is flawed. Object Pascal is quite clear regarding visibility
> rules. TObject has a Public constructor. You can only raise the
> visibility from there, not reduce visibility.
More information about the fpc-pascal
mailing list