I've just started using Xcode9 (beta2). My understanding was that it wouldn't force me to immediately change my code. However, I'm getting a build errors coming up with a library I'm using (Gloss):
1) For the following code:
public func valueForKeyPath(keyPath: String, withDelimiter delimiter: String = GlossKeyPathDelimiter, logger: Logger = GlossLogger()) -> Any? {
I get:
Initializer 'init()' is internal and cannot be referenced from a default argument value
2) For this code:
internal func flatMap<KeyPrime : Hashable, ValuePrime>(_ transform: (Key, Value) throws -> (KeyPrime, ValuePrime)?) rethrows -> [KeyPrime : ValuePrime] {
return Dictionary<KeyPrime,ValuePrime>(elements: try flatMap({ (key, value) in
return try transform(key, value)
}))
}
I'm getting:
Closure tuple parameter '(key: _, value: _)' does not support destructuring
Both of these caused no problem with Xcode 8.3/Swift 3.1.
I am using Xcode9 without having chosen the option to update to Swift 4. There seems several possibilities:
- There are some flags that need to be set to retain Swift 3.1 backwards compatibility
- Xcode9 is in beta and just isn't ready fully
- Xcode9 will not be completely backwards compatible to Swift 3.1
Thoughts?