TypeScript/tests/cases/conformance/controlFlow/controlFlowDeleteOperator.ts

18 lines
282 B
TypeScript
Raw Normal View History

2016-05-12 01:57:19 +02:00
// @strictNullChecks: true
function f() {
let x: { a?: number | string, b: number | string } = { b: 1 };
x.a;
x.b;
x.a = 1;
x.b = 1;
x.a;
x.b;
delete x.a;
delete x.b;
x.a;
x.b;
x;
delete x; // No effect
x;
}