"Cannot subscript a value of type '[String]'" and "Cannot assign value of type 'ArraySlice' to type '[String]?'" errors in Swift
<p>Xcode is giving me an error that makes no sense:</p>

<pre><code>let command = ["", "", ""]
let task = NSTask()
task.arguments = command[1...command.count-1]
</code></pre>

<blockquote>
  <p>Error: Cannot subscript a value of type '[String]'</p>
</blockquote>

<p>Why?</p>

<p>If I break it down:</p>

<pre><code>let command = ["", "", ""]
let a = command[1...command.count-1]
let task = NSTask()
task.arguments = a
</code></pre>

<blockquote>
  <p>Error: Cannot assign value of type 'ArraySlice' to type '[String]?'</p>
</blockquote>

<p>Why is Xcode physically incapable of producing error messages that make sense? Surely the original code wasn't so massively complex as to confuse the compiler!</p>

<p>Also, why can't I assign an ArraySlice to a variable of type Array?</p>