Graeme Geldenhuys :
> A very quick and dirty solution would be to reimplement the public
> Create() constructor and immediately raise an exception inside it,
> explaining the problem. That way if any developer tries to use that
> default constructor, they will get an error - instead of some silent
Of course you can't hide methods previously exposed in an inherited
class. But this applies to every member type (fields, properties,
methods), not just constructors. The point of a constructor is not to
new up a class (NewInstance does that), but to execute a block of code
(with checks) before tha
On Wednesday 11 November 2009 09:22:30 Graeme Geldenhuys wrote:
> Flávio Etrusco wrote:
> > Graeme, I guess the OP didn't want to reintroduce the 'Create'
> > constructor with lower visibility, just implement a second constructor
> > with private visiblity.
> > It can be useful when implementing si
Flávio Etrusco wrote:
>
> Graeme, I guess the OP didn't want to reintroduce the 'Create'
> constructor with lower visibility, just implement a second constructor
> with private visiblity.
> It can be useful when implementing singletons and factories to avoid
> some types of misuse by an unattentiv
QFT, Flávio said:
"Graeme, I guess the OP didn't want to reintroduce the 'Create'
constructor with lower visibility, just implement a second constructor
(** with a different name **) with private visiblity. It can be useful
when implementing singletons and factories to avoid some types of
misuse b
On Tue, Nov 10, 2009 at 10:56 AM, Graeme Geldenhuys
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 Er
On Tue, Nov 10, 2009 at 4:35 PM, Paul Nicholls wrote:
> - Original Message - From: "Anthony Walter"
> To: ; "FPC-Pascal users discussions"
>
> Sent: Wednesday, November 11, 2009 1:07 AM
> Subject: Re: [fpc-pascal] Compiler Warning: Constructor should be pub
- Original Message -
From: "Anthony Walter"
To: ; "FPC-Pascal users discussions"
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 identi
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, FileN
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 qu
On 10 Nov 2009, at 14:35, Anthony Walter wrote:
In my opinion the warning should be removed, or at least able to be
suppress through a switch.
FPC 2.4.0 will include the ability to suppress individual messages.
Use -vq to show the messages numbers, and -vm to suppress a
particular message
11 matches
Mail list logo