Bolts-Swift Compiler Errors Swift 4

468 Views Asked by At

I've migrated to Swift 4 and I'm using pods.

Within my Bolts-Swift framework I'm getting expected type error.

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
    }

Swift 4 Compiler Errors

It is expecting type Task "S" but it is returning that type? Apologies if this is a broad question but I really have no clue here.

1

There are 1 best solutions below

0
Joris On

The latest podspec only supports 3.0. If you want Swift 4 support you need to manually point to the repo

pod 'Bolts-Swift', :git => 'https://github.com/BoltsFramework/Bolts-Swift.git'