Skip to content

Instantly share code, notes, and snippets.

@jandamm
Created June 12, 2018 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jandamm/b2d7a20b8e83aca634570b1b8e0ff16c to your computer and use it in GitHub Desktop.
Save jandamm/b2d7a20b8e83aca634570b1b8e0ff16c to your computer and use it in GitHub Desktop.
protocol Test {
associatedtype Output
func test() -> Output
}
struct A: Test {
typealias Output = Void
func test() {
print("aa")
}
}
struct B: Test {
typealias Output = Int
func test() -> Int {
print("bb")
return 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment