I have the following code:
let foo: { a: { b: { c: number }}} | undefined;
foo?.a.b.c
As far I understand, only the foo variable should be typed as | undefined. But for some reason each path inside it is also marked as | undefined:
This doesn't make sense to me based on the compiled code that only checks the foo variable:
let foo;
foo === null || foo === void 0 ? void 0 : foo.a.b.c;
My expectation is that if foo is not undefined, the rest of the path is guaranteed to exists. Am I wrong?

