title: Dictionary containing an array - Why is unwrapping necessary?
body: <p>I'm trying to wrap my head around why what feels intuitive is illegal when it comes to a dictionary containing an array in Swift.</p>
  
  <p>Suppose I have:</p>
  
  <pre><code> var arr = [1,2,3,4,5]
   var dict = ["a":1, "b":2, "test":arr]
  </code></pre>
  
  <p>I can easily access the dictionary members like so:</p>
  
  <pre><code> dict["a"]
   dict["b"]
   dict["test"]
  </code></pre>
  
  <p>As expected, each of these will return the stored value, including the array for key "test":</p>
  
  <blockquote>
    <p>[1,2,3,4,5]</p>
  </blockquote>
  
  <p>My intuitive reaction to this based on other languages is that this should be legal:</p>
  
  <pre><code> dict["test"][2]
  </code></pre>
  
  <p>Which I would expect to return <code>3</code>.  Of course, this doesn't work in Swift.   After lots of tinkering I realize that this is the proper way to do this:</p>
  
  <pre><code> dict["test"]!.objectAtIndex(2)
  </code></pre>
  
  <p>Realizing this, I return to my intuitive approach and say, "Well then, this should work too:"</p>
  
  <pre><code> dict["test"]![2]
  </code></pre>
  
  <p>Which it does...  What I don't really get is why the unwrap isn't <em>implied</em> by the array dereference.  What am I missing in the way that Swift "thinks?"</p>