title: How can I create an instance of a Codable Struct?
body: <p>I am going round in circles trying to work with a Codable Struct. I can nearly get it to work, but I get an error at the end.</p>
  <p>Here is a simple example:</p>
  <pre class="lang-swift prettyprint-override"><code>struct Stuff: Codable {
      var title: String = &quot;&quot;
      var code: Int = 0
      struct Item {
          var name: String
          var value: Int
      }
      var items: [Item] = []
      init(from decoder: Decoder) throws { }
      func encode(to encoder: Encoder) throws { }
  }
  
  var items: [Stuff.Item] = []
  
  items.append(Stuff.Item(name: &quot;Apple&quot;, value: 1))
  items.append(Stuff.Item(name: &quot;banana&quot;, value: 2))
  
  var stuff = Stuff(title: &quot;test&quot;, code: 23, items: items)
  </code></pre>
  <p>On that last line I get the error</p>
  <blockquote>
  <p>Extra arguments at positions #1, #2, #3 in</p>
  </blockquote>
  <p>Clearly the nested struct is OK. If I remove the <code>:Codable</code> and the <code>init()</code> and <code>func encode()</code> it works as I would have expected.</p>
  <p>What is the correct way to do this?</p>