Re: cannot I override and mark it as private?

2021-05-12 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/12/21 5:55 PM, Basile B. wrote: On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote: I'd to change the visibility of a method overrided from public to private but it doesn't work tho to protected it does. Why is that? ... Why is that? why must I leave it accessible somehow (even if it's

Re: cannot I override and mark it as private?

2021-05-12 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote: I'd to change the visibility of a method overrided from public to private but it doesn't work tho to protected it does. Why is that? ... Why is that? why must I leave it accessible somehow (even if it's protected) to all derived class of

Re: cannot I override and mark it as private?

2021-05-12 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 12 May 2021 at 19:35:31 UTC, Jack wrote: I'd to change the visibility of a method overrided from public to private but it doesn't work tho to protected it does. Why is that? give: ```d class A { void f() { } } ``` this is ok: ```d class B : A { protected override void

cannot I override and mark it as private?

2021-05-12 Thread Jack via Digitalmars-d-learn
I'd to change the visibility of a method overrided from public to private but it doesn't work tho to protected it does. Why is that? give: ```d class A { void f() { } } ``` this is ok: ```d class B : A { protected override void f() { } } ``` this is not: ```d class B : A {