Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

Tony tonytdominguez at aol.com
Sun Apr 8 12:10:45 UTC 2018


On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote:
>
> The above in my case will give a deprecation warning that 
> "_baz" isn't visible from "Bar".
>
> Seems like a bug to me since I'm accessing "_baz" from "Foo" 
> itself and not from "Bar" or is it by design that you can't do 
> such thing.
>

I would say that you are accessing it from Bar. Or maybe that 
should be "via Bar". You are in Foo, but with a reference to a 
Bar instance. And trying to get to the _baz that is in that Bar 
instance. But your design doesn't allow (or at least I would have 
thought it was an error, not warning) or want Bar objects to be 
able to access _baz.


More information about the Digitalmars-d mailing list