                     return try Model.init(object: marshaledJSON)
                 }
             })
-                .mapError { Error.createMarshalError($0) }
+                .mapError { Error.createMarshalError($0 as! MarshalError) }
         }
     }
     

     */
    public func mapResponse<Model>(forKey key: KeyType? = nil) -> Signal<[Model], Error> where Model: Unmarshaling {
        return signal.attemptMap { json in
            Result(catching: {
                if ACKReactiveExtensionsConfiguration.allowMappingOnMainThread == false {
                    assert(Thread.current.isMainThread == false, "Mapping should not be performed on main thread!")
                }
                
                if let key = key, let marshaledJSON = json as? MarshaledObject {
                    return try marshaledJSON.value(for: key)
                }
                else if let marshaledArray = json as? [MarshaledObject] {
                    return try marshaledArray.map(Model.init)
                }
                else {
                    throw MarshalError.typeMismatch(expected: MarshaledObject.self, actual: type(of: json))
                }
            })
                .mapError { Error.createMarshalError($0) }
        }
    }
    

                }
                return try marshaledJSON.value(for: key)
            })
                .mapError { Error.createMarshalError($0 as! MarshalError) }
        }
    }
}
