Skip to content

Instantly share code, notes, and snippets.

@casademora
Created July 9, 2015 19:14
Show Gist options
  • Save casademora/443dad5d16d095f8747a to your computer and use it in GitHub Desktop.
Save casademora/443dad5d16d095f8747a to your computer and use it in GitHub Desktop.
Implement a method incorrectly by using generic rather than protocol parameter crashes clang compiler
protocol Thing {
var name: String { get }
}
protocol UsingThing {
func doSomething(with: Thing)
}
struct Test: UsingThing {
func doSomething<T: Thing>(thing: T) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment