// *** before: ***
// one wrong piece in a long expression made the compiler give up on the
// whole line: "expression was too complex to be solved in reasonable time"
// or "type of expression is ambiguous without more context", with the
// caret pointing at the very beginning
let totalOld = ["1", "2"].map { Int($0) }.reduce(0, +)
// *** in version 5.2: ***
// the type checker was rebuilt to keep going after a mistake, so it names
// the exact place and the exact trouble:
// "value of optional type 'Int?' must be unwrapped to a value of type 'Int'"
let total = ["1", "2"].compactMap { Int($0) }.reduce(0, +)
print(total)
// a missing member of a type now suggests the closest name, and a wrong
// argument label is offered as a fix instead of a wall of overloads