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

Седых Александр se-a at mail.ru
Mon Jan 23 04:24:18 CST 2017


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 .count = 1


Седых Александр
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170123/fe41db03/attachment.html>


More information about the swift-users mailing list