**TypeScript Version:** 3.7.0-dev.20190907 **Search Terms:** possibly undefined is:open **Code** ```ts function foo(value?: string) { if (value === undefined) { value = "hello"; } console.log(value.toUpperCase()); // OK setTimeout(() => value.toUpperCase(), 1); // TS2532 } ``` **Expected behavior:** Successful compilation. **Actual behavior:** Compilation failing with `error TS2532: Object is possibly 'undefined'.`. **Playground Link:** [www.typescriptlang.org/play/#code/…](http://www.typescriptlang.org/play/#code/GYVwdgxgLglg9mABMOcAUA3AhgGxAUwH4AuRAZygCcYwBzASkQG8AoRdxGYRTXAxALxDE4ACb5gNfKMZNE2PPkGIARAAt8OHHBUBuRAF82HCAjJwc+AHTbavRVahwAqgAdX+SgGEsZfGnp6XWN2PygAFRgAW3w4ECg0AMEAPnk+ayc3D29ff3oAGkQARiCWIyA) **Related Issues:** #31060