Skip to content

Instantly share code, notes, and snippets.

@narfdotpl
Last active August 29, 2015 14:23
Show Gist options
  • Save narfdotpl/404073078a35eb2822e1 to your computer and use it in GitHub Desktop.
Save narfdotpl/404073078a35eb2822e1 to your computer and use it in GitHub Desktop.
protocol Fooable {
var foo: String { get }
}
extension Fooable {
var foo: String {
return "foo"
}
}
extension Int: Fooable {}
extension SequenceType where Self.Generator.Element: Fooable {
var foo: String {
return "bar"
}
}
print(1.foo)
print([1, 2, 3].foo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment