I'm dipping my toe into Swift, but have run into an issue that has me slightly confused. Given an integer index I'm trying to fetch the corresponding key of a Dictionary and return the value associated with it.

Using the following structure as an example:

```
Class CustomClass {
    private var collection: [String: [SifterIssue]] = ["MyStringKey": [MyCustomCollectionClass]()]

    /* ... */
}

```

I tried to solve the problem like so:

```
var keys = Array(self.collection.keys)
var key: String = keys[section] as String
return self.collection[key].count // error is flagged here

```

But found that this results in a compiler error, which states that **'String' is not convertible to 'DictionaryIndex'**. Stumped, I tried a slightly more verbose solution and was surprised to find that this compiled and worked without issue. 

```
var keys = Array(self.collection.keys)
var key: String = keys[section] as String
var collection: [MyCustomCollectionClass] = self.collection[key]! as [MyCustomCollectionClass]
return issues.count

```

Can anyone explain to me why the first solution refuses to compile?