Last active
August 29, 2015 14:15
-
-
Save isoiphone/a1c8ec2e8fceae3be56b to your computer and use it in GitHub Desktop.
Swift 1.2 breaks my __FUNCTION__
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
// no longer compiles in swift 1.2 | |
func someFunc(block: () -> (), functionName: String = __FUNCTION__) { | |
println("NEAT!") | |
block() | |
} | |
someFunc { | |
println("oh") | |
} | |
/* | |
playground215.swift:7:10: error: missing argument for parameter #1 in call | |
someFunc { | |
^ | |
*/ | |
// UPDATE: ok this really never made sense. New behavior is better. | |
// now default functionName is first param, and closure is second. Works much better. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment