[swift-evolution] [Pitch] @testable private members

thislooksfun thislooksfun at repbot.org
Sat Feb 18 12:26:58 CST 2017


Whoops, accidentally sent this off-list.

-thislooksfun (tlf)

> On Feb 18, 2017, at 12:26 PM, thislooksfun <thislooksfun at repbot.org> wrote:
> 
> Big +1 from me. I see no point in having to elevate access just to make sure everything is working.
> 
> -thislooksfun (tlf)
> 
>> On Feb 18, 2017, at 12:14 PM, Matthew Johnson via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> When writing unit tests sometimes it is necessary to artificially elevate a member to `internal` in order to make it visible to unit tests where it could otherwise be `private` or `fileprivate`.  We could introduce an `@testable` attribute that could be applied anywhere an access modifier is used.  This attribute would elevate the access modifier to `internal` when the module is imported using the `@testable import MyModule` syntax in a test suite.
>> 
>> Is this something that others have interest in?  Is it something that might be considered for Swift 4 now that phase 2 has begun?
>> 
>> Matthew
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170218/e0101fe7/attachment.html>


More information about the swift-evolution mailing list