title: Codable variable inside Codable struct causes error
body: <p>Please take a look at my code:</p>
  <h3>No errors</h3>
  <pre class="lang-swift prettyprint-override"><code>struct Person: Codable {
      var name: String
      var age: Double
      var birthday: Date
      
      var selectedItem: Car
  }
  
  struct Car: Codable {
      var companyName: String
      var creationDate: Date
  }
  
  struct iPhone: Codable {
      var model: String
      var creationDate: Date
      var isScreenBroken: Bool = true
  }
  </code></pre>
  <h3>Build error</h3>
  <pre class="lang-swift prettyprint-override"><code>struct Person: Codable { // &quot;Type 'Person' does not conform to protocol 'Decodable'&quot;, &quot;Type 'Person' does not conform to protocol 'Encodable'&quot;
      var name: String
      var age: Double
      var birthday: Date
      
      var selectedItem: Codable // I've changed this line
  }
  
  struct Car: Codable {
      var companyName: String
      var creationDate: Date
  }
  
  struct iPhone: Codable {
      var model: String
      var creationDate: Date
      var isScreenBroken: Bool = true
  }
  </code></pre>
  <blockquote>
  <p>Type 'Person' does not conform to protocol 'Decodable'</p>
  </blockquote>
  <blockquote>
  <p>Type 'Person' does not conform to protocol 'Encodable'</p>
  </blockquote>
  <p>I don't understand why is this happening. It knows that <code>selectedItem</code> is conforming to <code>Encodable</code> &amp; <code>Decodable</code>:</p>
  <pre class="lang-swift prettyprint-override"><code>var selectedItem: Codable
  </code></pre>
  <p>I'm new to protocols in Swift so please when answering try to explain what's happening here.</p>
  <p>Thanks!</p>