Swift 3 unable to append array of objects, which conform to a protocol, to a collection of that protocol
<p>Below I have pasted code which you should be able to paste into a Swift 3 playground and see the error.</p>

<p>I have a protocol defined and create an empty array of that type.  I then have a class which conforms to the protocol which I try to append to the array but I get the below error.</p>

<pre><code>protocol MyProtocol {
    var text: String { get }
}

class MyClass: MyProtocol {
    var text = "Hello"
}
var collection = [MyProtocol]()
var myClassCollection = [MyClass(), MyClass()]
collection.append(myClassCollection)

argument type '[MyClass]' does not conform to expected type 'MyProtocol'
</code></pre>

<p>Note that collection += myClassCollection returns the following error:</p>

<pre><code>error: cannot convert value of type '[MyProtocol]' to expected argument type 'inout _'
</code></pre>

<p>This was working in earlier versions of Swift.</p>

<p>The only solution I have found so far is to iterate and add each element to the new array like so:</p>

<pre><code>for item in myClassCollection {
    collection.append(item)
}
</code></pre>

<p>Any help appreciated, thanks!</p>

<p><strong>EDIT</strong></p>

<p>The solution as show below is:</p>

<pre><code>collection.append(contentsOf: myClassCollection as [MyProtocol])
</code></pre>

<p>The real issue is a misleading compiler error when you are missing "as [MyProtocol]"</p>

<p>The compiler error reads:</p>

<pre><code>error: extraneous argument label 'contentsOf:' in call
collection.append(contentsOf: myClassCollection)
</code></pre>

<p>This error causes users to remove <code>contentsOf:</code> from the code which then causes the error I first mentioned.</p>