"Empty collection literal requires an explicit type" error on Swift3 : <p>I have a variable on my class:</p>

<pre><code>var list = []
</code></pre>

<p>and I use it on a function of my class:</p>

<pre><code>func chargeData (data: NSArray){
    list = data
}
</code></pre>

<p>It worked well on my project in <code>Swift 2.3</code> but when I have updated it to <code>XCode8</code> and <code>Swift3</code> it gives to me the following error:</p>

<blockquote>
  <p>Empty collection literal requires an explicit type</p>
</blockquote>

<p>so I have added a typecast to my list variable:</p>

<pre><code>var list = [] as! NSArray
</code></pre>

<p>but it gives to me the following alert:</p>

<blockquote>
  <p>Forced cast of 'NSArray' to same type has no effect</p>
</blockquote>

<p>I know that an alert does not broke the application but I would like to solve this error in a proper way.</p>

<p>Did someone got the same error and solved it properly?</p>

<p>Thanks in advance!</p>
