TypeScript Version: 2.1? (Playground)
Code
interfaceProps{foo: string;bar: string;}constp: Props={foo: 'hello',bar: 'world'}constsay=(props: Props)=>console.log(`${props.foo.length}${props.bar.length}`);say(p);deletep.bar;say(p);// works, but should throwSee here.
Expected behavior:
Don't compile, because we deletebar from p.
Actual behavior:
Compiles. Resulting in a runtime error: Uncaught TypeError: Cannot read property 'length' of undefined.
TypeScript Version: 2.1? (Playground)
Code
See here.
Expected behavior:
Don't compile, because we
deletebarfromp.Actual behavior:
Compiles. Resulting in a runtime error:
Uncaught TypeError: Cannot read property 'length' of undefined.