cannot I override and mark it as private?

Basile B. b2.temp at gmx.com
Wed May 12 21:55:15 UTC 2021


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 my derived class?

See specs : 
https://dlang.org/spec/attribute.html#visibility_attributes

> Symbols with private visibility can only be accessed from 
> within the same module. Private member functions are implicitly 
> final and cannot be overridden.




More information about the Digitalmars-d-learn mailing list