Skip to content

Instantly share code, notes, and snippets.

@hamishknight
Created October 16, 2016 19:08
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 hamishknight/ae0cb30c4e60771a1c21ef80f8188b9c to your computer and use it in GitHub Desktop.
Save hamishknight/ae0cb30c4e60771a1c21ef80f8188b9c to your computer and use it in GitHub Desktop.
func test(closure: () -> Void) -> () -> () {
let localClosure : @noescape () -> Void = { closure() }
localClosure()
return localClosure // Invalid conversion from non-escaping function of type () -> Void to potentially escaping function type () -> ()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment