Skip to content

Instantly share code, notes, and snippets.

@liorazi
Last active November 23, 2018 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liorazi/d426f6721aafa4fc23ca6d6e701f1e78 to your computer and use it in GitHub Desktop.
Save liorazi/d426f6721aafa4fc23ca6d6e701f1e78 to your computer and use it in GitHub Desktop.
Possible compiler bug in Swift 4.2
func foo(_ boo: String) {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) {
self.goo()
DispatchQueue.main.asyncAfter(deadline: .now() + 0.3) { //Swift 4.2 Compiler Error: Cannot invoke 'asyncAfter' with an argument list of type '(deadline: DispatchTime, @convention(block) ()
self.bar(nil)
}
}
}
func bar(_ sender:Any) {
}
func goo() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment