Consider the following code that tries to conditionally add a property to an object with an inferred type:
const foo = { a: 1, b: 2, }; if (bar) {