let elements: [(Int?, Int?)] = [(1, 2), (2, 1), (3, nil), (nil, 3), (5, 6), (6, 5)]
let result = elements.filter { $0.0 != nil } as! [(Int, Int?)]
Is there a more clean way to get partly non-optional type as a result? Without force-unwrapping...
When we filtering out nils it's should be obvious to compiler that we will get something non-optional. Like it is in the case when we applying compactMap for example.