title: Array of structs inside a struct
body: <p>Im trying to set a mapping to a struct that contains an array of structs inside. Like so:</p>
  <pre><code>struct ParentTokenDetails{
      TokenType _tokenType;
      address _tokenOwner;
      ChildTokenDetails[] children;
  }
  
  struct ChildTokenDetails{
      TokenType _tokenType;
      address _tokenOwner;
      bool _locked;
  }
  
  mapping(uint256 =&gt; ParentTokenDetails) public TokenEnums;
  </code></pre>
  <p>I have a function where I try to do this but so far no luck:</p>
  <pre><code>function test()
      public
      returns (uint256)
  {
      uint256 newItemId = 1;
      ParentTokenDetails._tokenType = TokenType.NON_FUNGIBLE;
      ParentTokenDetails._tokenOwner = msg.sender;
      ParentTokenDetails.children = ChildTokenDetails([TokenType.NULL, msg.sender, false]);
      TokenEnums[newItemId] = ParentTokenDetails;
  
      return newItemId;
  }
  </code></pre>
  <p>Which prompts the error:</p>
  <blockquote>
  <p>TypeError: Type struct EndLabsEnum.ChildTokenDetails memory is not implicitly convertible to expected type struct EndLabsEnum.ChildTokenDetails storage ref[] storage ref.</p>
  </blockquote>
  <p>Ideally I would be able to create a struct for a new Id with an empty struct array I can add information to later.</p>
  <p>Any pointers would help!</p>
  <p>Full contract:</p>
  <pre><code>//SPDX-License-Identifier:MIT
  pragma solidity 0.8.13;
  
  contract TestEnum {
      enum TokenType{ FUNGIBLE, NON_FUNGIBLE, NULL }
      address public owner;
  
      struct ParentTokenDetails{
          TokenType _tokenType;
          address _tokenOwner;
          ChildTokenDetails[] children;
      }
      struct ChildTokenDetails{
          TokenType _tokenType;
          address _tokenOwner;
          bool _locked;
      }
      mapping(uint256 =&gt; ParentTokenDetails) public TokenEnums;
  
      constructor(){
          owner = msg.sender;
      }
  
      // Ensure minting of assets with duplicated Ids fail
      function mintNonFungibleTokenEnum(uint256 tokenID)
          public
          returns (uint256)
      {
          uint256 newItemId = 1;
          ParentTokenDetails._tokenType = TokenType.NON_FUNGIBLE;
          ParentTokenDetails._tokenOwner = msg.sender;
          ParentTokenDetails.children = ChildTokenDetails([TokenType.NULL, msg.sender, false]);
          TokenEnums[newItemId] = ParentTokenDetails;
  
          return newItemId;
  }
  </code></pre>