1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
tests/cases/compiler/strictNullEmptyDestructuring.ts(3,5): error TS2461: Type 'null' is not an array type.
tests/cases/compiler/strictNullEmptyDestructuring.ts(3,5): error TS2531: Object is possibly 'null'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(5,5): error TS2531: Object is possibly 'null'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(7,2): error TS2531: Object is possibly 'null'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(9,5): error TS2532: Object is possibly 'undefined'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(11,2): error TS2532: Object is possibly 'undefined'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(13,5): error TS2531: Object is possibly 'null'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(15,2): error TS2531: Object is possibly 'null'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(17,5): error TS2532: Object is possibly 'undefined'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(19,2): error TS2532: Object is possibly 'undefined'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(21,5): error TS2533: Object is possibly 'null' or 'undefined'.
tests/cases/compiler/strictNullEmptyDestructuring.ts(23,2): error TS2533: Object is possibly 'null' or 'undefined'.
==== tests/cases/compiler/strictNullEmptyDestructuring.ts (12 errors) ====
// Repro from #20873
let [] = null;
~~
!!! error TS2461: Type 'null' is not an array type.
~~
!!! error TS2531: Object is possibly 'null'.
let { } = null;
~~~
!!! error TS2531: Object is possibly 'null'.
({} = null);
~~
!!! error TS2531: Object is possibly 'null'.
let { } = undefined;
~~~
!!! error TS2532: Object is possibly 'undefined'.
({} = undefined);
~~
!!! error TS2532: Object is possibly 'undefined'.
let { } = Math.random() ? {} : null;
~~~
!!! error TS2531: Object is possibly 'null'.
({} = Math.random() ? {} : null);
~~
!!! error TS2531: Object is possibly 'null'.
let { } = Math.random() ? {} : undefined;
~~~
!!! error TS2532: Object is possibly 'undefined'.
({} = Math.random() ? {} : undefined);
~~
!!! error TS2532: Object is possibly 'undefined'.
let { } = Math.random() ? null : undefined;
~~~
!!! error TS2533: Object is possibly 'null' or 'undefined'.
({} = Math.random() ? null : undefined);
~~
!!! error TS2533: Object is possibly 'null' or 'undefined'.
|