TypeScript/tests/cases/compiler/strictNullEmptyDestructuring.ts
Jack Williams 4acdca5258 Enforce strictNullChecks for RHS of empty destructuring assignment
When strictNullChecks is on, check the RHS of the following
destructuring assignments for possible null or undefined:

const {} = ...
const [] = ...
let {} = ...
let [] = ...
({} = ...)
2018-01-10 01:46:36 +00:00

26 lines
380 B
TypeScript

// @strictNullChecks: true
// Repro from #20873
let [] = null;
let { } = null;
({} = null);
let { } = undefined;
({} = undefined);
let { } = Math.random() ? {} : null;
({} = Math.random() ? {} : null);
let { } = Math.random() ? {} : undefined;
({} = Math.random() ? {} : undefined);
let { } = Math.random() ? null : undefined;
({} = Math.random() ? null : undefined);