阅读背景:

Swift generics error: Cannot convert value of type 'Type' to expected argument type 'Type<_>'

来源:互联网 

Please consider this setup:

请考虑以下设置:

protocol MyProcotol {
}

class MyModel: MyProcotol {
}

enum Result<T> {
    case success(value: T)
    case failure
}

class Test {
    func test<T: MyProcotol>(completion: (Result<T>) -> Void) {
        let model = MyModel()
        let result = Result.success(value: model)
        completion(result)
    }
}
protoc



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: