As you can see, the weekly brief has a new home! It feels much nicer to have a dedicated site rather than my personal blog. I’m sure there are still some bugs lurking around, so if you find any or have suggestions for improvements to the site, please open an issue on GitHub!

Commits and pull requests

Erik Little, Jesse Rusak, and Mike Ash discovered a really cool bug. This compiles:

enum Testing: String {
    case Thing = "thing"
    case Bob = {!@#$!@#%!@} // lolwut
}

Daniel Duan and Jesse Rusak both attempted fixes. Perhaps Daniel’s currently open pull request will get merged?

Jacob Bandes-Storch fixed 4 compiler crashers thanks to @practicalswift’s fuzzer. And then 8 more crashers, plus an IDE crasher. 😂

@Atrick fixed a leak when interpolating optional references. (SR-459)

Brian Gesiak’s “testing the tests” pull request finally merged! He is now the #1 contributor to corelibs-xctest according to GitHub. 😦

Proposals

Loïc Lecrenier’s proposal, “Replace typealias keyword with associatedtype for associated type declarations”, has been accepted for Swift 2.2! Using typealias in protocols will be deprecated in 2.2 and removed from 3.0 entirely. It should be easy to migrate your existing code.

Doug Gregor submitted a proposal, “Referencing the Objective-C selector of a method”. It’s a dream come true. This has been a glaring issue from the beginning for interoperability with Objective-C. It looks like this feature can be added in Swift 2.2 and deprecate the use of string literals, after which 3.0 would remove the old syntax entirely.

“In Swift 2, Objective-C selectors are written as string literals (e.g., "insertSubview:aboveSubview:") in the type context of a Selector. This proposal seeks to replace this error-prone approach with Selector initialization syntax that refers to a specific method via its Swift name.” 👏

David Farler’s proposal, “Swift Language Version Build Configuration” is under review. “Over time, Swift syntax may change but library and package authors will want their code to work with multiple versions of the language.” This proposal would allow programmatically checking the Swift version number, for example #if swift(>=2.2). As a library author, I would welcome this feature!

Mailing lists

After a ton of discussion on the mailing list (and github 😳), the proposal for testing support in the Swift Package Manager is moving back to “under revision” to incorporate even more feedback from the community.

Chris Hanson started a thread discussing adding XCTest support for Swift error handling. This would make throws a first-class citizen within XCTest, where it is currently a bit cumbersome and awkward to use. Remember that time when XCTest didn’t really work with optionals? 😄

Drew Crawford started a thread discussing how the Swift Package Manager could support third-party testing frameworks. I know a lot of developers in the community would love this, as it would allow using frameworks other than XCTest for testing.