[swift-evolution] [swift-evolution-announce] [Accepted with Revision] SE-0177: Allow distinguishing between public access and public overridability

Matthew Johnson matthew at anandabits.com
Wed Jul 27 20:50:45 CDT 2016


> On Jul 27, 2016, at 8:47 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
> 
>> On Jul 27, 2016, at 6:43 PM, Matthew Johnson <matthew at anandabits.com> wrote:
>> 
>>> In a future version of Swift, we might consider refining this by requiring people to apply `@testable` directly to declarations which treat something closed as if it's open, but it seems like even the current feature set does not make testing impossible.
>> 
>> +1 to @testable on declarations.  I really do not like making things internal when they should be private just because a test needs to inspect state.
> 
> Whoa, that wasn't what I was suggesting at all. I was suggesting that the *test suite* should mark the forbidden subclass/override with `@testable`.

Sorry, I misread that.  But I still stand by the enhancement to @testable I mentioned.  There are times when access control is wider than necessary to support tests and it always sucks doing that.

> 
> -- 
> Brent Royal-Gordon
> Architechies
> 



More information about the swift-evolution mailing list