[Cuis-dev] Why can't you send to super on private (pvt*) methods?

Andres Valloud ten at smallinteger.com
Tue Jun 11 15:37:35 PDT 2019


Seriously?  You can't do super pvt in a pvt method?

I'd begin by asking what was the problem that approach was meant to 
solve in the first place.  If you don't know why things are the way they 
are, it's tough to figure out whether they should be changed in a 
reasonable manner.

On 6/10/19 15:24, Juan Vuletich via Cuis-dev wrote:
> On 6/10/2019 5:09 PM, Phil B via Cuis-dev wrote:
>> Something I've never understood is why you can't send super on pvt* 
>> methods?  The sends are still contained to the class hierarchy and 
>> it's legal for a superclass to send to a pvt* that is only defined on 
>> a subclass... so why isn't going in the other direction allowed?
> 
> Good question! I see no reason. Given that a class can assign values to 
> inherited variables, there's already no protection. So I think that 
> calling super pvt* method should be allowed. Anybody can see a reason?
> 
> BTW, we'd really make methods such as #setCollection:, 
> #setNumerator:denominator:, actually all methods set*, all methods 
> private* and all methods in a 'private*' category actually private... 
> For example the comment at #privateSetX:setY: looks so silly.
> 
> Opinions?
> 


More information about the Cuis-dev mailing list