title: SwiftUI ForEach open vs closed range
body: <p>I'd like to understand ForEach loop and ranges. Here is the code:</p>
  
  <p>This is valid:</p>
  
  <pre><code>ForEach(0..&lt;5) {
     Text("Number: \($0)")
  }
  </code></pre>
  
  <p>This throws exception <em>Generic parameter 'ID' could not be inferred</em>:</p>
  
  <pre><code>ForEach(0...4) {
     Text("Number: \($0)")
  }
  </code></pre>
  
  <p>I can fix it by specifying id:</p>
  
  <pre><code>ForEach(0...4, id: \.self) {
     Text("Number: \($0)")
  }
  </code></pre>
  
  <p>I was wondering why the first range <code>0..&lt;5</code> is <em>Identifiable</em> and the <code>0..4</code> is not. They are the same type <code>Range&lt;Int&gt;</code>. I just don't understand.</p>
  
  <p>Many thanks!</p>