This is a misleading error message - the ambiguity actually lies in the closure expression you pass to map(_:), since Swift cannot infer the return type of a multi-line closure without any external context.
Thus, you can do the closure in one line using the ternary conditional operator:
let strs = things.filter { $0.id == "1"} .map { _ in
(x == 1) ? "a" : "b"
}
Or simply supply the compiler with some explicit return type information map(_:):
let strs = things.filter { $0.id == "1"} .map { _ -> String in
let strs : [String] = things.filter { $0.id == "1"} .map { _ in