I am looking the correct syntax of this code:
extension Optional where Wrapped == Array<Element> where Element == Hashable {
}
The elements of Array are Hashable.
CodePudding user response:
You can either constrain every member, or use a typealias. But you can't use properties unless you use the typealias solution.
typealias OptionalHashableArray<Hashable: Swift.Hashable> = [Hashable]?
extension OptionalHashableArray {
var