Avatar
norio_nomura 4/18/2018 2:59 AM
https://bugs.swift.org/browse/SR-7450 より @swift-4.2.4 protocol DictionaryType { associatedtype Key associatedtype Value } protocol A: DictionaryType where Key == Value { static func foo() } extension A { static func foo() { print(type(of: self)) } } extension Dictionary: DictionaryType {} extension Dictionary: A where Key == Value { } extension Array where Element: A { static func foo() { Element.foo() } } [String: String].foo() // Dictionary<String, String> [[String: String]].foo() // Crash