title: Swift "Unable to infer complex closure return type; add explicit type to disambiguate" because of a dictionary
body: <p>I have this following dictionary:</p>
  <pre><code>@State var ustasList: Dictionary&lt;Usta, String&gt; = [Usta: String]() 
  </code></pre>
  <p>And this view:</p>
  <pre><code>        ZStack(alignment: .top){
                  DropDown(defaultText: self.chosenUsta, font: self.fontStartAndButton, expand: false, options: self.ustaTypes){ opt in
                      print(self.ustasList)
                  }
                      .padding([.top, .leading, .trailing])
                  .zIndex(2)
              List{
                  ForEach(self.ustasList.sorted(by: &lt;), id: \.self){ item,typ in
                      Text(item)
                   }
              }
           }
  </code></pre>
  <p>However this code gives me the following error:  <code>Unable to infer complex closure return type; add explicit type to disambiguate</code>.I tried to change trhe ForEach line to</p>
  <pre><code>ForEach(self.ustaTypes, id: \.self){ item in  
  </code></pre>
  <p>Where ustaTypes is a simple one-dimensional string array and it worked properly. So why isn't it working with a dictionary?</p>