New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not compile with Xcode 9 and Swift 4 #119
Comments
+1 |
This works for me: private static func async<O>(after seconds: Double? = nil, block: @escaping () -> O, queue: GCD) -> AsyncBlock<Void, O> {
let reference = Reference<O>()
let block = DispatchWorkItem(block: {
reference.value = block()
})
if let seconds = seconds {
let time = DispatchTime.now() + seconds
queue.queue.asyncAfter(deadline: time, execute: block)
} else {
queue.queue.async(execute: block)
}
// Wrap block in a struct since @convention(block) () -> Swift.Void can't be extended
return AsyncBlock<Void, O>(block, output: reference)
} |
I also need swift4, hoping to use it as soon as possible |
Same issue. |
From migration-guide-swift4 |
#122 looks like it would fix this, fwiw |
+1 |
1 similar comment
+1 |
thanks
2017-09-27 10:36 GMT+08:00 returnight <notifications@github.com>:
… +1
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#119 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AZh7y_yfriw17rH-TzOMTyQBUehAsLLLks5smbSigaJpZM4N5e9R>
.
|
@duemunk Any updates on this? Thanks! |
Fixed by #122 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Side note: I also tried to convert the Async project with Xcode 9 + Swift 4 but we get a bunch of errors due to
Void => ()
conversion which requires declaring closure params explicitly, very annoying. Not sure if that's a swift 4 beta bug or something that needs to be worked on.The text was updated successfully, but these errors were encountered: