迅速。无法将<t>类型的值转换为预期的参数类型&lt; _&gt;

时间:2016-05-24 09:01:45

标签: ios swift generics

func arrayRequest<T>(request: Request<T>, callback: ((result: Results<T>) -> ())) {
    let parseOperation = buildRequest(request)
    parseOperation.completionBlock = {
        dispatch_async(dispatch_get_main_queue(), {
            guard let parsedObject = parseOperation.results else {
                callback(result: Results.Failure(Error.RequestError))
                return
            }
            let results = Results.Success(parsedObject)
            callback(result: callback(result: results)) //Error
        })
    }
}

我有错误: 无法转换'结果&lt;类型的值T&gt;'预期参数类型'结果&lt; _&gt;'

enum Results<T> {
    case Failure(Error)
    case Success([T]) }

0 个答案:

没有答案