Dictionary literal; adding an array
<p>Take the two following samples: Why can I not add an array to a dictionary literal from an array variable?</p>

<p>This works:</p>

<pre><code>class test{

    var myarray: [String?] = []

    var dictionary: [String: AnyObject]{
        get {
            return [
                "object": [
                    "array":["",""],
                ],
            ]
        }
    }
}
</code></pre>

<p>But this does not work? "<code>Contextual type 'AnyObject' cannot be used with dictionary literal."</code></p>

<pre><code>    class test{

        var myarray: [String?] = []

        var dictionary: [String: AnyObject]{
            get {
                return [
                    "object": [
                        "array":[self.myarray],
                        ],
                ]
            }
        }
    }
</code></pre>