A lot has been happening in the last two weeks. I think a long intro would only distract you from all the interesting bits, so let’s get into it…
Tired of wasting time debugging your Swift app? Instabug’s SDK is here to help you minimize your debugging time by providing you with complete device details, network logs, and reproduction steps with every bug report. All data is attached automatically. It only takes a line of code to setup. Signup now for free.
- SR-9795 [Compiler] Cannot use
superin lazy property: ‘super’ cannot be used outside of class members
- SR-9851 [Compiler] Incorrect fixit for logical NOT operator on value of
- TF-46 [Tests] Create unit tests for functions in TFUtilities.
- TF-51 [Stdlib] Check and diagnose that a
graph_opis valid when creating a
On the Swift Community Podcast, Jon Shier, Kelvin Ma and Chris Lattner discuss the
Result type that is being introduced in Swift 5.
News and community
Xcode 10.2 beta 3 is shipping with a stable ABI. 🎉🎉🎉
In another post on the Swift blog, Joe Groff wrote about Evolving Swift on Apple Platforms After ABI Stability.
Commits and pull requests
Feedback on the initial proposal was mostly positive, but several people expressed some reservations about some of the new API, and the authors agreed to reduce the proposal to a more minimal change. That new version generally met with approval, with a few dissents:
- Some community members took the opportunity to register their disapproval of the lack of integer indexing into String. While those complaints are noted, this review was not the place to air them.
- Lily Ballard expressed concern about the lack of structure of these encoded offsets and about their behavior when the offset does not correspond to a scalar boundary. The Core Team generally agrees with the proposal author that the offset not matching a scalar boundary is a programmer error for which trapping is consistent with Swift’s general behavior on similar precondition violations.
Proposals in review
This proposal aims to solve a simple outstanding problem with the way the Swift compiler currently synthesizes the memberwise initializer for structures by synthesizing default values for properties with default initializers.
Right now, you can make a function foo take a function that optionally throws, and only throw if the given function also throws, like this:
However, you can not make a function take an object with a method that optionally throws and only throw if it throws:
This pitch would allow you to do that.
Vectors, understood as 2, 3, or 4-component numerical aggregates, are a fundamental currency type across many domains of programming. This document seeks to lay out a cohesive vision for adding standard vector support to the Swift language, with consideration for relevant long-term goals for the language type system.
The Windows port has been coming along pretty well. Although it is not yet complete, it is now at the point where you can start doing interesting things with it. As such, I put together a little Hello World^WSwift program for Windows using just Swift! As the saying goes, a picture is worth a thousand words …