title: Swift 4 Decodable - Dictionary with enum as key
body: <p>My data structure has an enum as a key, I would expect the below to decode automatically. Is this a bug or some configuration issue?</p>
  
  <pre><code>import Foundation
  
  enum AnEnum: String, Codable {
    case enumValue
  }
  
  struct AStruct: Codable {
    let dictionary: [AnEnum: String]
  }
  
  let jsonDict = ["dictionary": ["enumValue": "someString"]]
  let data = try! JSONSerialization.data(withJSONObject: jsonDict,     options: .prettyPrinted)
  let decoder = JSONDecoder()
  do {
    try decoder.decode(AStruct.self, from: data)
  } catch {
    print(error)
  }
  </code></pre>
  
  <p>The error I get is this, seems to confuse the dict with an array.</p>
  
  <blockquote>
    <p>typeMismatch(Swift.Array, Swift.DecodingError.Context(codingPath:
    [Optional(__lldb_expr_85.AStruct.(CodingKeys in
    _0E2FD0A9B523101D0DCD67578F72D1DD).dictionary)], debugDescription: "Expected to decode Array but found a dictionary instead."))</p>
  </blockquote>