Created
August 7, 2016 23:29
-
-
Save khanlou/4b1ad88528ad1256e4c357b0034c68fc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 doThing(defaultable value: Int = 4, _ required: Void -> Int) -> Int { | |
| return value + required() | |
| } | |
| doThing(defaultable: 4, { 6 }) // works | |
| doThing { 6 } // works | |
| doThing({ 6 }) // doesn't compile: Missing argument for parameter #2 in call |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment