Skip to content

Instantly share code, notes, and snippets.

@Otbivnoe
Created October 3, 2018 19:00
Show Gist options
  • Save Otbivnoe/a122818ce59b4b7a19ec947b16553adb to your computer and use it in GitHub Desktop.
Save Otbivnoe/a122818ce59b4b7a19ec947b16553adb to your computer and use it in GitHub Desktop.
protocol ProtocolWithAssociatedType {
associatedtype T
}
struct Test<T>: ProtocolWithAssociatedType {} // no compile error
struct Test: ProtocolWithAssociatedType {} // error: Type 'Test' does not conform to protocol 'ProtocolWithAssociatedType'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment