let test: [Int]? = nil
for b in test ?? [] where b != 42 {
   Print(b)

}

I don't think you need new syntax since what you want can be accomplished
quite succinctly already


On Sat, Feb 11, 2017 at 8:18 AM Anton Zhilin via swift-evolution <
[email protected]> wrote:

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)
}

​
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to