Created
November 2, 2015 07:21
-
-
Save NetguruGist/90d7556bec6ca6d4009c to your computer and use it in GitHub Desktop.
error6 swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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