google / promises

Promises is a modern framework that provides a synchronization construct for Swift and Objective-C.
Apache License 2.0
3.8k stars 293 forks source link

Remove unnecessary block cast #56

Closed adlerj closed 6 years ago

adlerj commented 6 years ago

The block cast in Promise+Retry.swift isn't needed:

"C typedefs of block types are imported as typealiass for Swift closures.

The primary result of this is that typedefs for blocks with a parameter of type BOOL are imported as closures with a parameter of type Bool (rather than ObjCBool as in the previous release). This matches the behavior of block parameters to imported Objective-C methods. (22013912)"

https://github.com/apple/swift/blob/master/CHANGELOG.md

The implementation for compilations with swift versions < 4.1 fail. This PR fixes #55 by removing the broken code.

ghost commented 6 years ago

Hi Jeffrey,

Without the version check, this will fail for Xcode 9 and Swift versions less than 4.1. I tested this in both Xcode 9.0 and 9.4 and everything was building for me locally as well as passing travis-ci build tests.

What version of Xcode are you using? Are you using Swift 4.0?

jonathanekim commented 6 years ago

Change looks good to me.

jonathanekim commented 6 years ago

I believe https://github.com/google/promises/pull/59 fixes this issue. Please reopen if it does not!