tests/cases/compiler/downlevelLetConst16.ts(195,14): error TS2461: Type 'undefined' is not an array type. tests/cases/compiler/downlevelLetConst16.ts(202,15): error TS2459: Type 'undefined' has no property 'a' and no string index signature. tests/cases/compiler/downlevelLetConst16.ts(216,16): error TS2461: Type 'undefined' is not an array type. tests/cases/compiler/downlevelLetConst16.ts(223,17): error TS2459: Type 'undefined' has no property 'a' and no string index signature. ==== tests/cases/compiler/downlevelLetConst16.ts (4 errors) ==== 'use strict' declare function use(a: any); var x = 10; var y; var z; use(x); use(y); use(z); function foo1() { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = {a: 1}; use(z); } function foo2() { { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = { a: 1 }; use(z); } use(x); } class A { m1() { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = { a: 1 }; use(z); } m2() { { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = { a: 1 }; use(z); } use(x); } } class B { m1() { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } m2() { { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } use(x); } } function bar1() { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } function bar2() { { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } use(x); } module M1 { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = { a: 1 }; use(z); } module M2 { { let x = 1; use(x); let [y] = [1]; use(y); let {a: z} = { a: 1 }; use(z); } use(x); } module M3 { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } module M4 { { const x = 1; use(x); const [y] = [1]; use(y); const {a: z} = { a: 1 }; use(z); } use(x); use(y); use(z); } function foo3() { for (let x; ;) { use(x); } for (let [y] = []; ;) { use(y); } for (let {a: z} = {a: 1}; ;) { use(z); } use(x); } function foo4() { for (const x = 1; ;) { use(x); } for (const [y] = []; ;) { use(y); } for (const {a: z} = { a: 1 }; ;) { use(z); } use(x); } function foo5() { for (let x in []) { use(x); } use(x); } function foo6() { for (const x in []) { use(x); } use(x); } function foo7() { for (let x of []) { use(x); } use(x); } function foo8() { for (let [x] of []) { ~~~ !!! error TS2461: Type 'undefined' is not an array type. use(x); } use(x); } function foo9() { for (let {a: x} of []) { ~ !!! error TS2459: Type 'undefined' has no property 'a' and no string index signature. use(x); } use(x); } function foo10() { for (const x of []) { use(x); } use(x); } function foo11() { for (const [x] of []) { ~~~ !!! error TS2461: Type 'undefined' is not an array type. use(x); } use(x); } function foo12() { for (const {a: x} of []) { ~ !!! error TS2459: Type 'undefined' has no property 'a' and no string index signature. use(x); } use(x); }