Issue #109 17 May 2018
Written by: Bas Broek
I’m starting to get more excited about WWDC by the day right now. Looking forward to meeting people and learning about all new technologies and APIs that we will be seeing. It feels so long ago since last year’s WWDC!
Also, if you’re there too, feel free to say hi! 👋
That being said, here is another two weeks of interesting Open Source Swift news, including another few awesome proposals (I am not complaining, but what happened with that March 1 “deadline”?) and interesting announcements.
- SR-7562 [Compiler]
@discardableResultis disregarded for a required init method
- SR-7574 [Compiler] Use libfuzzer on the demangler
- SR-7624 [Compiler] Fixits for ‘Argument passed to call that takes no arguments’
- SR-7629 [Compiler] Wrong fixit when the type doesn’t conform to a public protocol
In episode 57, Jesse and JP discuss the Swift for TensorFlow Design Overview that we mentioned two weeks ago.
In episode 58, Jesse and JP discuss the reimplentation of Implicitly Unwrapped Optionals (IUOs) in Swift, and what that brings us.
News and community
Commits and pull requests
Introduced during the bring-up of the generics system in July, 2012,
SubstitutionList) have been completely superseded by
The core team accepted one of the two proposed Sequence extensions, with a different name than was proposed:
You can find more details about the decision behind the new name in the announcement.
The proposal is accepted as written. Thanks to everyone who participated in the review.
SE-0212 — Compiler Version Directive has been accepted. There was no major concerns about the proposal.
Tusing the appropriate literal protocol if possible.
Currently types conforming to literal protocols are type-checked using regular initializer rules, which means that for expressions like
UInt32(42)the type-checker is going to look up a set of available initializer choices and attempt them one-by-one trying to deduce the best solution.
The core team discussed this today. A line has to be drawn somewhere between this special syntactic rule and a general higher-order use of initializers as functions;
let f = T.initis not going to preserve the special rule.
In that light, it makes sense to the core team to tie the special behavior to the existing special syntactic rule of type construction: currently, a “call” of
Tdirectly is recognized as always meaning a call to an initializer, whereas this syntax simply adjusts that to sometimes construct a literal.
T.initis then reserved to always mean a higher-order use of the overloaded initializer set.
The number of projects in the Swift ecosystem keeps expanding and developers are using them more and more to help build their apps. While not officially a part of the language, they exist to provide a leg up on development with optimizations to accomplish specific sets of tasks.
Related Projects includes access to specific sub-categories that are dedicated to projects within the Swift community and are separate from the Swift language itself. This new section of Swift Forums is launching today with support for a number of projects, including:
Stringis a collection whose element is
Character, which represents an extended grapheme cluster (commonly just called “grapheme”). This makes
Characterone of the first types encountered both by newcomers to Swift as well as by experienced Swift developers playing around in new domains (e.g. scripting). Yet
Characterexposes little functionality other than the ability to order it with respect to other characters, and a way to access the raw Unicode scalar values that comprise it.
Devin Coughlin announced that exclusive access warnings will be treated as errors in Swift 4.2.
In the recent Swift 4.2 branch, the existing Swift 4.1 warning about ‘overlapping accesses’ is now an error in Swift 4 mode. This means that projects with this warning will fail to build with the Swift 4.2 compiler.
The warning typically arises when a mutating method that modifies a variable is passed a non-escaping closure that reads from the same variable.