Last active
August 29, 2015 14:06
-
-
Save bencochran/8e87240f540f33fbe0ba to your computer and use it in GitHub Desktop.
Swift specificity
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
import Foundation | |
func doStuff(item: Any) { | |
println("Do stuff with this: \(item)") | |
} | |
class Foo { | |
func doStuff() { | |
doStuff(self) // <- Won’t compile. “Cannot convert 'Foo' to type '() -> ()'” | |
} | |
} | |
let f = Foo() | |
doStuff(f) | |
f.doStuff() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In a non-playground setting, looks like you can specify
ModuleName.doStuff()
to get at the right function.