[swift-evolution] for in? optionalCollection {

Anton Zhilin antonyzhilin at gmail.com
Sat Feb 11 07:18:27 CST 2017


for i in test ?? [] {
    print(i)
}

For a more general solution, we could add Optional.flatten() to support
optional sequences:

for i in test.flatten() {
    print(i)
}

​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170211/3feac37f/attachment.html>


More information about the swift-evolution mailing list