Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created November 2, 2015 07:21
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 NetguruGist/90d7556bec6ca6d4009c to your computer and use it in GitHub Desktop.
Save NetguruGist/90d7556bec6ca6d4009c to your computer and use it in GitHub Desktop.
error6 swift
func throwingOperation() throws -> Int {}
func nonThrowingOperation() -> Int {}
func performOperation(operation: () -> Int) -> Int {
return operation()
}
performOperation(throwingOperation) // wrong - Invalid conversion from throwing function ... to non-throwing ...
performOperation(nonThrowingOperation) // correct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment