         }
 
         let task = adapter.resumedTaskWithURLRequest(URLRequest) { data, URLResponse, error in
-            let result: Result<T.Response, SessionTaskError>
+            let result: Result<Request.Response, SessionTaskError>
 
             switch (data, URLResponse, error) {
             case (_, _, let error?):

        return task
    }

    public func cancelRequest<T: RequestType>(requestType: T.Type, passingTest test: T -> Bool = { r in true }) {
        adapter.getTasksWithHandler { [weak self] tasks in
            tasks
                .filter { task in
                    if let request = self?.requestForTask(task) as T? {
                        return test(request)
                    } else {
                        return false

        }
    }

    private func setRequest<Request: RequestType>(request: Request, forTask task: SessionTaskType) {
        objc_setAssociatedObject(task, &taskRequestKey, Box(request), .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
    }

    private func requestForTask<Request: RequestType>(task: SessionTaskType) -> Request? {
        return (objc_getAssociatedObject(task, &taskRequestKey) as? Box<Request>)?.value
    }
}
