title: Array.forEach creates error "Cannot convert value of type '()' to closure result type '_'"
body: <p>I am trying to loop through an array in SwuftUI to render multiple text strings in different locations. Going through the array manually works, but using forEach-loop produces an error.
  In the code sample below, I have commented out the manual approach (which works).
  This kind of approach worked in this tutorial for drawing lines (<a href="https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes" rel="nofollow noreferrer">https://developer.apple.com/tutorials/swiftui/drawing-paths-and-shapes</a>)</p>
  
  <p>(As a bonus question: is there a way to get the index/key of the individual positions through this approach, without adding that key in to the positions-Array for each of the rows?)</p>
  
  <p>I have tried various approaches like ForEach, adding identified() in there as well, and adding various type definitions for the closure, but I just end up creating other errors</p>
  
  <pre><code>import SwiftUI
  
  var positions: [CGPoint] = [
      CGPoint(x: 100, y: 100),
      CGPoint(x: 100, y: 200),
      CGPoint(x: 100, y: 300),
  ]
  
  struct ContentView : View {
      var body: some View {
          ZStack {
              positions.forEach { (position) in
                  Text("Hello World")
                      .position(position)
              }
  /* The above approach produces error, this commented version works
             Text("Hello World")
                  .position(positions[0])
              Text("Hello World")
                  .position(positions[1])
              Text("Hello World")
                  .position(positions[2]) */
          }
      }
  }
  
  #if DEBUG
  struct ContentView_Previews : PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  #endif
  </code></pre>