Skip to content

Instantly share code, notes, and snippets.

@es-kumagai
Created March 3, 2016 02:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save es-kumagai/e2d0fbcffc4d80db5ce9 to your computer and use it in GitHub Desktop.
Save es-kumagai/e2d0fbcffc4d80db5ce9 to your computer and use it in GitHub Desktop.
完全にわかった! @gillygize さんの教えてくれた通りに動くみたい。衝突すると「衝突した」ではなくて「準拠してない」って出る。 #CodePiece #tryswiftconf
protocol A {
func method() -> String
}
protocol B {
func method() -> String
}
extension A {
func method() -> String {
return "A"
}
}
extension B {
func method() -> String {
return "B"
}
}
// NG : Type 'Value' does not conforms to protocol 'A'
// NG : Type 'Value' does not conforms to protocol 'B'
struct Value : A, B {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment