enum Numbers: String {
case one, two, three
}
// In argument type 'Numbers.Type', 'Numbers' does not conform to expected type 'JSONDecodable'
let number = try? json.decode(at: 0, type: Numbers.self)
This is fully intended behavior. We can't make your types conform to JSONDecodable for you; we can only provide default implementations for your implementation.
Following code causes error:
But if I add
the error's gone.
Shouldn't
Numbers
adoptJSONDecodable
implicitly?Swift 3, Xcode 8