1

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.

B. Desai
  • 16,414
  • 5
  • 26
  • 47
David Henry
  • 1,972
  • 20
  • 43

1 Answers1

0

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'
Joris Mans
  • 6,024
  • 6
  • 42
  • 69