Tighter generics implementations. You can now pass any SequenceType's for methods that previously only accepts Array's.

This commit is contained in:
John Rommel Estropia
2015-09-19 18:20:52 +09:00
parent 7451fbe026
commit 114b7ce605
10 changed files with 33 additions and 80 deletions

View File

@@ -171,7 +171,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
"Attempted to delete an entities from an already committed \(typeName(self))."
)
super.delete([object1, object2] + objects)
super.delete(([object1, object2] + objects).flatMap { $0 })
}
/**
@@ -179,7 +179,7 @@ public final class AsynchronousDataTransaction: BaseDataTransaction {
- parameter objects: the `NSManagedObject`s type to be deleted
*/
public override func delete(objects: [NSManagedObject?]) {
public override func delete<S: SequenceType where S.Generator.Element == NSManagedObject>(objects: S) {
CoreStore.assert(
!self.isCommitted,