title: Unable to infer complex closure return type with SwiftUI
body: <p>Following part 3 of Apple's tutorial on SwiftUI, <a href="https://developer.apple.com/tutorials/swiftui/handling-user-input" rel="noreferrer">Handling User Input</a>, I get this error: </p>
  
  <blockquote>
    <p>Unable to infer complex closure return type; add explicit type to disambiguate</p>
  </blockquote>
  
  <p>I'm using the same code as the tutorial (even coping from the 'Complete' sample code doesn't resolve the error). </p>
  
  <p>Does anyone have a cue what is going wrong here? </p>
  
  <p><a href="https://i.stack.imgur.com/inaIz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/inaIz.png" alt="enter image description here"></a></p>
  
  <pre><code>struct LandmarkRow: View {
      var landmark: Landmark
  
      var body: some View {
          HStack {
              landmark.image(forSize: 50)
              Text(verbatim: landmark.name)
              Spacer()
  
              if landmark.isFavorite {
                  Image(systemName: "star.fill")
                      .imageScale(.medium)
              }
          }
      }
  }
  </code></pre>
  
  <p>Regardless of the cause of the issue, how could you indeed add an explicit type to disambiguate here? What would the return type in such a case be? </p>
  
  <p>-- </p>
  
  <p><strong>Update</strong> </p>
  
  <p>Apparently you should not continue with your result of the 2nd tutorial with the 3rd. Some things changed in between of the tutorials that is not documented in the tutorial. I've added the project files to Github so you can <a href="https://github.com/teameh/Apple-SwiftUI-Tutorials-SampleCode/commit/de5d13f4bf72fe57ab31c7ea094414f794a44ba8#diff-3a2226d5793d4d66ab461e74ea1a9920R19" rel="noreferrer">check out the diff</a>.</p>
  
  <p>It's better to start the 3rd tutorial fresh with a fresh download of the Project files of the <a href="https://developer.apple.com/tutorials/swiftui/handling-user-input" rel="noreferrer">3rd tutorial</a>. </p>