Less than a week after the last beta was released, Swift 1.1 beta 2 is up. And yes, it’s officially Swift 1.1, as displayed by running swift -v from the command line.
Presumably we’re gearing up for a new GM alongside Yosemite, as there are almost no changes to the standard library in this release, much like when the GM was almost upon us for 6.0. Not surprising, since the Swift team had already confirmed on the dev forums that 6.1 was going to be a fairly small release.
The only material change are to the RawRepresentable
protocol, and the _RawOptionSetType
which inherits from it:
RawRepresentable
’sRaw
typealias is nowRawValue
.- Instead of a
toRaw
function, it now has a read-onlyrawValue
property. - Instead of a
fromRaw
class function, it now defines aninit?
that takes a raw value. _RawOptionSetType
also now defines aninit
that takes a raw value, rather than a class functionfromMask
.
This matches the release notes, which state that enums construction from raw values have been changed to take advantage of the new failable initializers introduced in the last beta.
Interesting thing to note: while RawRepresentable
has an init?(rawValue: RawValue)
method, _RawOptionSetType
has an init(rawValue: RawValue)
method. This might seem odd at first – _RawOptionSetType
inherits from RawRepresentable
, shouldn’t they have the same kind of init
? But since init
is more restrictive than init?
, it works, as an optional type can always be substituted with its non-optional equivalent. _RawOptionSetType
is essentially restating RawRepresentable
’s raw initializer as non-optional after all.
Here’s looking forward to a Swift 1.1 GM, and maybe after that on to 1.2?