Swift3.0 Cannot convert value of type 'ClosedRange<Index>' to type 'Range<Index>'
<p>I'm trying to migrate the Swift 2.3 to 3.0 and post-conversion facing this issue. Any suggestion what I'm doing wrong. </p>

<h3>Swift 3.0:</h3>

<pre><code>override func setValue(_ value: AnyObject?, forKey key: String) {
    let uppercasedFirstCharacter = String(key.characters.first!).uppercased()
    let range = key.startIndex...key.index(key.startIndex, offsetBy: 0)
    let selectorString = key.replacingCharacters(in: range, with: uppercasedFirstCharacter)

    let selector = NSSelectorFromString("set\(selectorString):")
    let responds = self.responds(to: selector)

    if !responds {
        return
    }
</code></pre>

<blockquote>
  <h3>Error:</h3>
  
  <p><em>let selectorString = key.replacingCharacters(in: range, with: uppercasedFirstCharacter)</em></p>

<pre><code>Cannot convert value of type 'ClosedRange&lt;Index&gt;' (aka 'ClosedRange&lt;String.CharacterView.Index&gt;') to expected argument type 'Range&lt;Index&gt;' (aka 'Range&lt;String.CharacterView.Index&gt;')
</code></pre>
</blockquote>

<h3>Original code: Swift 2.3</h3>

<pre><code>override func setValue(value: AnyObject?, forKey key: String) {
    let uppercasedFirstCharacter = String(key.characters.first!).uppercaseString

    let range = key.startIndex...key.startIndex.advancedBy(0)
    let selectorString = key.stringByReplacingCharactersInRange(range, withString: uppercasedFirstCharacter)

    let selector = NSSelectorFromString("set\(selectorString):")
    let responds = self.respondsToSelector(selector)

    if !responds {
        return
    }
</code></pre>