Closed adlerj closed 6 years ago
I'm not sure that the swift version check is even necessary...
"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)"
Appears that the issue has to do with the Xcode version rather than a specific Swift version. So checking if Swift version is >=4.1 will not suffice.
Based on the check used here: https://github.com/realm/SwiftLint/pull/2038/commits/133cef8df1af0e9c4a8efc98a2ce63f39c530f72
We will need to do the following: (!swift(>=4.1) || (!swift(>=4.0) && swift(>=3.3)))
I believe #59 fixes this issue. Please reopen if it does not!
When we are on swift version < 4.1 the predicateBlock has type
var predicateBlock: ((_ count: Int, _ error: Error) -> ObjCBool)?
This gives an error when used below in the onQueue call because the condition type is defined as:
typedef BOOL (^FBLPromiseRetryPredicateBlock)(NSInteger, NSError *)