Swift: Extend Optional Array
<p>I'd like to extend <code>Optional</code>, where <code>Wrapped</code> is an array (with elements of any type). In other words, I want to add a function to <code>[Any]?</code>. I'm just not sure how to declare that. I've tried:</p>

<p>1.</p>

<pre><code>extension Optional where Wrapped: Array
</code></pre>

<p>results in:</p>

<pre><code>error: reference to generic type 'Array' requires arguments in &lt;...&gt;
</code></pre>

<p>2.</p>

<pre><code>extension Optional where Wrapped: Array&lt;Any&gt;
</code></pre>

<p>results in:</p>

<pre><code>type 'Wrapped' constrained to non-protocol type 'Array&lt;Any&gt;'
</code></pre>

<p>and various other similar declarations. Help is appreciated.</p>