mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SDK] Resolve unsafeBitCast warnings in the CoreData overlay (#7118)
No intended functionality change.
This commit is contained in:
@@ -15,10 +15,10 @@ import Foundation
|
||||
|
||||
extension NSManagedObjectContext {
|
||||
public func fetch<T: NSFetchRequestResult>(_ request: NSFetchRequest<T>) throws -> [T] {
|
||||
return try fetch(unsafeBitCast(request, to: NSFetchRequest<NSFetchRequestResult>.self)) as! [T]
|
||||
return try fetch(unsafeDowncast(request, to: NSFetchRequest<NSFetchRequestResult>.self)) as! [T]
|
||||
}
|
||||
|
||||
public func count<T: NSFetchRequestResult>(for request: NSFetchRequest<T>) throws -> Int {
|
||||
return try count(for: unsafeBitCast(request, to: NSFetchRequest<NSFetchRequestResult>.self))
|
||||
return try count(for: unsafeDowncast(request, to: NSFetchRequest<NSFetchRequestResult>.self))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user