title: Using Decodable in Swift 4 with Inheritance
body: <p>Should the use of class inheritance break the Decodability of class.  For example, the following code </p>
  
  <pre><code>class Server : Codable {
      var id : Int?
  }
  
  class Development : Server {
      var name : String?
      var userId : Int?
  }
  
  var json = "{\"id\" : 1,\"name\" : \"Large Building Development\"}"
  let jsonDecoder = JSONDecoder()
  let item = try jsonDecoder.decode(Development.self, from:json.data(using: .utf8)!) as Development
  
  print(item.id ?? "id is nil")
  print(item.name ?? "name is nil") here
  </code></pre>
  
  <p>output is: </p>
  
  <pre><code>1
  name is nil
  </code></pre>
  
  <p>Now if I reverse this, name decodes but id does not.</p>
  
  <pre><code>class Server {
      var id : Int?
  }
  
  class Development : Server, Codable {
      var name : String?
      var userId : Int?
  }
  
  var json = "{\"id\" : 1,\"name\" : \"Large Building Development\"}"
  let jsonDecoder = JSONDecoder()
  let item = try jsonDecoder.decode(Development.self, from:json.data(using: .utf8)!) as Development
  
  print(item.id ?? "id is nil")
  print(item.name ?? "name is nil")
  </code></pre>
  
  <p>output is:</p>
  
  <pre><code>id is nil
  Large Building Development
  </code></pre>
  
  <p>And you can't express Codable in both classes. </p>