TypeScript Version: 2.3.4
Code
constfoo=(bar?: {baz: number})=>{if(bar==null){bar={baz: 0};}constbaz=()=>{console.log(bar.baz);// Object is possibly undefined};baz();};Playground link
Expected behavior:
No error
Actual behavior:
Error "Object is possibly undefined"
TypeScript Version: 2.3.4
Code
Playground link
Expected behavior:
No error
Actual behavior:
Error "Object is possibly undefined"