Re: [swift-users] Why this string not work. Any and Optionals in dictionary

2017-01-23 Thread Ole Begemann via swift-users
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

Re: [swift-users] Why this string not work. Any and Optionals in dictionary

2017-01-23 Thread Quinn "The Eskimo!" via swift-users
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

Re: [swift-users] Why this string not work. Any and Optionals in dictionary

2017-01-23 Thread Adrian Zubarev via swift-users
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

[swift-users] Why this string not work. Any and Optionals in dictionary

2017-01-23 Thread Седых Александр via swift-users
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