I have a simple expression with Any and is not work. Why?
vardictarray: [[String: Any]] = [["kek": nil]]
\\ Nil is not compatible with expected dictionary value type 'Any'
`nil` is just a literal value that doesn't have a specific type. Even
though you want to put it in a dictionary whose
On 23 Jan 2017, at 10:24, Седых Александр via swift-users
wrote:
> I have a simple expression with Any and is not work. Why?
The problem here is that:
* `nil` is syntactic sugar for `Optional.none`, where `Optional` is
generic on the `Wrapped` type
* You’re not given
There is no universal `nil`. `nil` is typed. That said think of `nil` as a
shorthand form for `Optional.none`
--
Adrian Zubarev
Sent with Airmail
Am 23. Januar 2017 um 11:24:18, Седых Александр via swift-users
(swift-users@swift.org(mailto:swift-users@swift.org)) schrieb:
>
> Hello.
> I
Hello.
I have a simple expression with Any and is not work. Why?
var dictarray: [[ String : Any ]] = [[ "kek" : nil ]]
\\ Nil is not compatible with expected dictionary value type 'Any'
--
And in other hand this is work
var dictarray: [[ String : Any ]] = [[:]] \\ [[:]], dictarray