XCode 7.3 fixes

This commit is contained in:
John Estropia
2016-03-23 12:07:31 +09:00
parent c323a28c19
commit 5ca0f657cb
7 changed files with 29 additions and 25 deletions

View File

@@ -111,22 +111,24 @@ public struct MigrationChain: NilLiteralConvertible, StringLiteralConvertible, D
public init(dictionaryLiteral elements: (String, String)...) {
var valid = true
let versionTree = elements.reduce([String: String]()) { (var versionTree, tuple: (String, String)) -> [String: String] in
var versionTree = [String: String]()
elements.forEach { (sourceVersion, destinationVersion) in
if let _ = versionTree.updateValue(tuple.1, forKey: tuple.0) {
guard let _ = versionTree.updateValue(destinationVersion, forKey: sourceVersion) else {
CoreStore.assert(false, "\(typeName(MigrationChain))'s migration chain could not be created due to ambiguous version paths.")
valid = false
return
}
return versionTree
CoreStore.assert(false, "\(typeName(MigrationChain))'s migration chain could not be created due to ambiguous version paths.")
valid = false
}
let leafVersions = Set(
elements.filter { (tuple: (String, String)) -> Bool in
return versionTree[tuple.1] == nil
}.map { $1 }
}.map { $1 }
)
let isVersionAmbiguous = { (start: String) -> Bool in