ARTICLE AD BOX
I am wondering why my build process reports a TS18048 (value possibly undefined). I figured out this behavior is caused by using a value in an arrow function. Here is some kind of minimal example:
interface Foo { bar?: Foo; baz: string; } const foo: Foo = { bar: { baz: "baz" }, baz: "baz" }; if (foo.bar !== undefined) { (() => console.log(foo.bar.baz)); // TS18048 } const thingToLog = foo.bar; if (thingToLog !== undefined) { (() => console.log(thingToLog)); // Works fine. }Probably I'm really not seeing the forest for the trees, but I'm wondering why thingToLog does not raise an error while foo.bar does.
