[fpc-pascal] Compiler Warning: Constructor should be public

Paul Nicholls paulfnicholls at gmail.com
Tue Nov 10 22:35:18 CET 2009


----- Original Message ----- 
From: "Anthony Walter" <sysrpl at gmail.com>
To: <graemeg at opensoft.homeip.net>; "FPC-Pascal users discussions" 
<fpc-pascal at lists.freepascal.org>
Sent: Wednesday, November 11, 2009 1:07 AM
Subject: Re: [fpc-pascal] Compiler Warning: Constructor should be public


> 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
>
<SNIP>

Hi Anthony,
    Sorry, but you are incorrect; "Create" is a method, not an identifier, 
and like all methods, it is affected by visibility rules (public, private, 
protected).

cheers,
Paul 




More information about the fpc-pascal mailing list