         
         do {
             let objects = try fetch(request)
-            return objects.map { $0[named] as AnyObject }
+            return objects.flatMap { $0[named] as? Result }
         } catch {
             Logging.log("fetchEntityAttribute error: \(error)")
             return []


private protocol CoreStack {
    var mainContext: NSManagedObjectContext! { get }
    var databaseFilePath: URL? { get }
    func performUsingWorker(closure: ((NSManagedObjectContext) -> ()))
}

        }
    }
    
    public func fetchAttribute<T: NSManagedObject, Result>(named: String, on entity: T.Type, limit: Int? = nil, predicate: NSPredicate = .truePredicate) -> [Result] {
        let request: NSFetchRequest<NSDictionary> = NSFetchRequest(entityName: T.entityName())
        request.resultType = .dictionaryResultType
        request.propertiesToFetch = [named]
