title: Swift array subscript extension "Range<T> is not convertible to Int"
body: <p>I'm defining an extension on Array to override Slice creation:</p>
  
  <pre><code>struct S&lt;T&gt; {
      private var array: [T] = []
      private var first = 0
      private var len = 0
  
      init(_ array: [T], _ range: Range&lt;Int&gt;? = nil) {
          self.array = array
          if let range = range {
              self.first = range.startIndex
              self.len = range.endIndex
          } else {
              self.first = 0
              self.len = array.count
          }
      }
  }
  
  extension Array {
      subscript(subRange: Range&lt;Int&gt;) -&gt; S&lt;T&gt; {
          return S&lt;T&gt;(self, subRange)
      }
  }
  
  let a = [4, 3, 2, 1, 0, -1][2..&lt;4 as Range&lt;Int&gt;]
  </code></pre>
  
  <p>However, I'm getting an error on defining a: "Range is not convertible to Int" (without the cast the error is "HalfOpenInterval ..."). What am I doing wrong?</p>