我已经迁移到 Swift 4 并且正在使用 pod。
在我的 Bolts-Swift 框架中,我收到了预期的类型错误。
public func continueWith<S>(_ executor: Executor = .default, continuation: @escaping ((Task) throws -> S)) -> Task<S> {
return continueWithTask(executor) { task in
let state = TaskState.fromClosure({
try continuation(task)
})
return Task<S>(state: state as! TaskState<_>) // Error with this line
}
它期待类型任务“S”,但它正在返回该类型?抱歉,如果这是一个广泛的问题,但我在这里真的不知道。