From af91582494a65bf9f6fb49f7a0037d5eaae3e4f6 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Fri, 30 Jan 2026 13:50:27 -0800 Subject: [PATCH] Deprecate downlevelIteration --- src/compiler/program.ts | 3 ++ src/compiler/types.ts | 1 + .../ES5For-of33(target=es2015).errors.txt | 8 +++ .../ES5For-of33(target=es5).errors.txt | 2 + .../ES5For-of34(target=es2015).errors.txt | 2 + .../ES5For-of34(target=es5).errors.txt | 2 + .../ES5For-of35(target=es2015).errors.txt | 2 + .../ES5For-of35(target=es5).errors.txt | 2 + .../ES5For-of36(target=es2015).errors.txt | 2 + .../ES5For-of36(target=es5).errors.txt | 2 + .../ES5For-of37(target=es2015).errors.txt | 20 +++++++ .../ES5For-of37(target=es2015).types | 2 + .../ES5For-of37(target=es5).errors.txt | 2 + tests/baselines/reference/api/typescript.d.ts | 1 + .../arrayLiteralSpreadES5iterable.errors.txt | 28 ++++++++++ ...owFunction11_es5(target=es2015).errors.txt | 12 +++++ ...ArrowFunction11_es5(target=es5).errors.txt | 2 + ...wnlevelGenerator(target=es2015).errors.txt | 11 ++++ ...sInDownlevelGenerator(target=es2015).types | 1 + ...nDownlevelGenerator(target=es5).errors.txt | 2 + ...atternAndAssignment1ES5iterable.errors.txt | 2 + ...rnAndAssignment4(target=es2015).errors.txt | 2 + ...tternAndAssignment4(target=es5).errors.txt | 2 + ...arameterDeclaration1ES5iterable.errors.txt | 2 + ...tion3ES5iterable(target=es2015).errors.txt | 2 + ...aration3ES5iterable(target=es5).errors.txt | 2 + ...tion7ES5iterable(target=es2015).errors.txt | 18 +++++++ ...aration7ES5iterable(target=es5).errors.txt | 2 + ...VariableDeclaration1ES5iterable.errors.txt | 46 ++++++++++++++++ ...ns01_ES5iterable(target=es2015).errors.txt | 9 ++++ ...atterns01_ES5iterable(target=es2015).types | 7 +++ ...terns01_ES5iterable(target=es5).errors.txt | 2 + ...ns02_ES5iterable(target=es2015).errors.txt | 10 ++++ ...atterns02_ES5iterable(target=es2015).types | 21 ++++++++ ...terns02_ES5iterable(target=es5).errors.txt | 2 + ...ns03_ES5iterable(target=es2015).errors.txt | 9 ++++ ...atterns03_ES5iterable(target=es2015).types | 9 ++++ ...terns03_ES5iterable(target=es5).errors.txt | 2 + ...ns04_ES5iterable(target=es2015).errors.txt | 10 ++++ ...atterns04_ES5iterable(target=es2015).types | 21 ++++++++ ...terns04_ES5iterable(target=es5).errors.txt | 2 + ...ns01_ES5iterable(target=es2015).errors.txt | 53 +++++++++++++++++++ ...atterns01_ES5iterable(target=es2015).types | 23 ++++++++ ...terns01_ES5iterable(target=es5).errors.txt | 2 + ...ns02_ES5iterable(target=es2015).errors.txt | 2 + ...terns02_ES5iterable(target=es5).errors.txt | 2 + ...BindingDownlevel(target=es2015).errors.txt | 29 ++++++++++ ...ionBindingDownlevel(target=es5).errors.txt | 2 + ...wnlevelGenerator(target=es2015).errors.txt | 9 ++++ ...nDownlevelGenerator(target=es5).errors.txt | 2 + ...lidationVarInDownLevelGenerator.errors.txt | 8 +++ ...MapValidationVarInDownLevelGenerator.types | 1 + 52 files changed, 422 insertions(+) create mode 100644 tests/baselines/reference/ES5For-of33(target=es2015).errors.txt create mode 100644 tests/baselines/reference/ES5For-of37(target=es2015).errors.txt create mode 100644 tests/baselines/reference/arrayLiteralSpreadES5iterable.errors.txt create mode 100644 tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).errors.txt create mode 100644 tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt create mode 100644 tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.errors.txt create mode 100644 tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt create mode 100644 tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt create mode 100644 tests/baselines/reference/restParameterInDownlevelGenerator(target=es2015).errors.txt create mode 100644 tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.errors.txt diff --git a/src/compiler/program.ts b/src/compiler/program.ts index b0314dc12e53a..15ded0cd85bf5 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -4550,6 +4550,9 @@ export function createProgram(_rootNamesOrOptions: readonly string[] | CreatePro if (options.module === ModuleKind.None || options.module === ModuleKind.AMD || options.module === ModuleKind.UMD || options.module === ModuleKind.System) { createDeprecatedDiagnostic("module", ModuleKind[options.module], /*useInstead*/ undefined, /*related*/ undefined); } + if (options.downlevelIteration) { + createDeprecatedDiagnostic("downlevelIteration"); + } }); } diff --git a/src/compiler/types.ts b/src/compiler/types.ts index df5d03e7ef964..f29c72e6b07e3 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -7431,6 +7431,7 @@ export interface CompilerOptions { disableSourceOfProjectReferenceRedirect?: boolean; disableSolutionSearching?: boolean; disableReferencedProjectLoad?: boolean; + /** @deprecated */ downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; diff --git a/tests/baselines/reference/ES5For-of33(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of33(target=es2015).errors.txt new file mode 100644 index 0000000000000..8526a41e391b4 --- /dev/null +++ b/tests/baselines/reference/ES5For-of33(target=es2015).errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== ES5For-of33.ts (0 errors) ==== + for (var v of ['a', 'b', 'c']) { + console.log(v); + } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of33(target=es5).errors.txt b/tests/baselines/reference/ES5For-of33(target=es5).errors.txt index 3c3e980a6111e..eb20b8948363d 100644 --- a/tests/baselines/reference/ES5For-of33(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of33(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of33.ts (0 errors) ==== for (var v of ['a', 'b', 'c']) { diff --git a/tests/baselines/reference/ES5For-of34(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of34(target=es2015).errors.txt index f144c20c30d3b..53369d956bcf3 100644 --- a/tests/baselines/reference/ES5For-of34(target=es2015).errors.txt +++ b/tests/baselines/reference/ES5For-of34(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of34.ts (1 errors) ==== function foo() { return { x: 0 }; diff --git a/tests/baselines/reference/ES5For-of34(target=es5).errors.txt b/tests/baselines/reference/ES5For-of34(target=es5).errors.txt index 77c17bf4f3ce9..8d79a3bddf2e4 100644 --- a/tests/baselines/reference/ES5For-of34(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of34(target=es5).errors.txt @@ -1,7 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of34.ts (1 errors) ==== function foo() { diff --git a/tests/baselines/reference/ES5For-of35(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of35(target=es2015).errors.txt index 64fe6dcc61a3a..c30049c74e1a3 100644 --- a/tests/baselines/reference/ES5For-of35(target=es2015).errors.txt +++ b/tests/baselines/reference/ES5For-of35(target=es2015).errors.txt @@ -1,7 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'. ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of35.ts (2 errors) ==== for (const {x: a = 0, y: b = 1} of [2, 3]) { ~ diff --git a/tests/baselines/reference/ES5For-of35(target=es5).errors.txt b/tests/baselines/reference/ES5For-of35(target=es5).errors.txt index 0742153fdb980..0e68e02bf3491 100644 --- a/tests/baselines/reference/ES5For-of35(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of35(target=es5).errors.txt @@ -1,8 +1,10 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'. ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of35.ts (2 errors) ==== for (const {x: a = 0, y: b = 1} of [2, 3]) { diff --git a/tests/baselines/reference/ES5For-of36(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of36(target=es2015).errors.txt index c39a271f1749a..6fb9a86db02b0 100644 --- a/tests/baselines/reference/ES5For-of36(target=es2015).errors.txt +++ b/tests/baselines/reference/ES5For-of36(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of36.ts(1,10): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of36.ts (1 errors) ==== for (let [a = 0, b = 1] of [2, 3]) { ~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/ES5For-of36(target=es5).errors.txt b/tests/baselines/reference/ES5For-of36(target=es5).errors.txt index eb02b78a66de2..8616786ea9e19 100644 --- a/tests/baselines/reference/ES5For-of36(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of36(target=es5).errors.txt @@ -1,7 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ES5For-of36.ts(1,10): error TS2548: Type 'number' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of36.ts (1 errors) ==== for (let [a = 0, b = 1] of [2, 3]) { diff --git a/tests/baselines/reference/ES5For-of37(target=es2015).errors.txt b/tests/baselines/reference/ES5For-of37(target=es2015).errors.txt new file mode 100644 index 0000000000000..1fc51555dfb21 --- /dev/null +++ b/tests/baselines/reference/ES5For-of37(target=es2015).errors.txt @@ -0,0 +1,20 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== ES5For-of37.ts (0 errors) ==== + // https://github.com/microsoft/TypeScript/issues/30083 + + for (const i of [0, 1, 2, 3, 4]) { + try { + // Ensure catch binding for the following loop is reset per iteration: + for (const j of [1, 2, 3]) { + if (i === 2) { + throw new Error('ERR'); + } + } + console.log(i); + } catch (err) { + console.log('E %s %s', i, err); + } + } \ No newline at end of file diff --git a/tests/baselines/reference/ES5For-of37(target=es2015).types b/tests/baselines/reference/ES5For-of37(target=es2015).types index 58c2d9689f3f5..232bb657472a6 100644 --- a/tests/baselines/reference/ES5For-of37(target=es2015).types +++ b/tests/baselines/reference/ES5For-of37(target=es2015).types @@ -64,6 +64,7 @@ for (const i of [0, 1, 2, 3, 4]) { } catch (err) { >err : any +> : ^^^ console.log('E %s %s', i, err); >console.log('E %s %s', i, err) : void @@ -79,5 +80,6 @@ for (const i of [0, 1, 2, 3, 4]) { >i : number > : ^^^^^^ >err : any +> : ^^^ } } diff --git a/tests/baselines/reference/ES5For-of37(target=es5).errors.txt b/tests/baselines/reference/ES5For-of37(target=es5).errors.txt index 2454a2d838de1..15136797e10a2 100644 --- a/tests/baselines/reference/ES5For-of37(target=es5).errors.txt +++ b/tests/baselines/reference/ES5For-of37(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== ES5For-of37.ts (0 errors) ==== // https://github.com/microsoft/TypeScript/issues/30083 diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index 96243aa142da3..7fc0696c151af 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -7033,6 +7033,7 @@ declare namespace ts { disableSourceOfProjectReferenceRedirect?: boolean; disableSolutionSearching?: boolean; disableReferencedProjectLoad?: boolean; + /** @deprecated */ downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; diff --git a/tests/baselines/reference/arrayLiteralSpreadES5iterable.errors.txt b/tests/baselines/reference/arrayLiteralSpreadES5iterable.errors.txt new file mode 100644 index 0000000000000..25d947181393c --- /dev/null +++ b/tests/baselines/reference/arrayLiteralSpreadES5iterable.errors.txt @@ -0,0 +1,28 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== arrayLiteralSpreadES5iterable.ts (0 errors) ==== + function f0() { + var a = [1, 2, 3]; + var a1 = [...a]; + var a2 = [1, ...a]; + var a3 = [1, 2, ...a]; + var a4 = [...a, 1]; + var a5 = [...a, 1, 2]; + var a6 = [1, 2, ...a, 1, 2]; + var a7 = [1, ...a, 2, ...a]; + var a8 = [...a, ...a, ...a]; + } + + function f1() { + var a = [1, 2, 3]; + var b = ["hello", ...a, true]; + var b: (string | number | boolean)[]; + } + + function f2() { + var a = [...[...[...[...[...[]]]]]]; + var b = [...[...[...[...[...[5]]]]]]; + } + \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).errors.txt b/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).errors.txt new file mode 100644 index 0000000000000..86b20e3a14e3e --- /dev/null +++ b/tests/baselines/reference/asyncArrowFunction11_es5(target=es2015).errors.txt @@ -0,0 +1,12 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== asyncArrowFunction11_es5.ts (0 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/24722 + class A { + b = async (...args: any[]) => { + await Promise.resolve(); + const obj = { ["a"]: () => this }; // computed property name after `await` triggers case + }; + } \ No newline at end of file diff --git a/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).errors.txt b/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).errors.txt index e199d801eef1b..b2c3d15fef43d 100644 --- a/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).errors.txt +++ b/tests/baselines/reference/asyncArrowFunction11_es5(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== asyncArrowFunction11_es5.ts (0 errors) ==== // https://github.com/Microsoft/TypeScript/issues/24722 diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt new file mode 100644 index 0000000000000..5bce00ed7da5a --- /dev/null +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt @@ -0,0 +1,11 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== blockScopedBindingsInDownlevelGenerator.ts (0 errors) ==== + function* a() { + for (const i of [1,2,3]) { + (() => i)() + yield i + } + } \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).types b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).types index 957f447f8e574..60f40d20f0646 100644 --- a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).types +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es2015).types @@ -29,6 +29,7 @@ function* a() { yield i >yield i : any +> : ^^^ >i : number > : ^^^^^^ } diff --git a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).errors.txt b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).errors.txt index f34c1e623c972..c95e0220edeef 100644 --- a/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).errors.txt +++ b/tests/baselines/reference/blockScopedBindingsInDownlevelGenerator(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== blockScopedBindingsInDownlevelGenerator.ts (0 errors) ==== function* a() { diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt index 991b50d74ccc4..d6586191035ca 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@ -1,8 +1,10 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== /* AssignmentPattern: * ObjectAssignmentPattern diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt index 2501eb11dda9c..2a31f9c1274ff 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2488: Type 'number[] | null' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== // #35497 diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es5).errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es5).errors.txt index 8ed44abf71c56..be466a6b913e5 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es5).errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment4(target=es5).errors.txt @@ -1,7 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2548: Type 'number[] | null' is not an array type or does not have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== // #35497 diff --git a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt index fc9339ce290b6..38b4f9fd38995 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration1ES5iterable.errors.txt @@ -1,3 +1,4 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringParameterDeclaration1ES5iterable.ts(12,4): error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. Source has 4 element(s) but target allows only 3. destructuringParameterDeclaration1ES5iterable.ts(57,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. @@ -6,6 +7,7 @@ destructuringParameterDeclaration1ES5iterable.ts(62,10): error TS2393: Duplicate destructuringParameterDeclaration1ES5iterable.ts(63,10): error TS2393: Duplicate function implementation. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringParameterDeclaration1ES5iterable.ts (4 errors) ==== // A parameter declaration may specify either an identifier or a binding pattern. // The identifiers specified in parameter declarations and binding patterns diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt index 3d2a00a310a3a..e05201d10c867 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt @@ -1,3 +1,4 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringParameterDeclaration3ES5iterable.ts(26,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Source has 5 element(s) but target allows only 3. destructuringParameterDeclaration3ES5iterable.ts(29,12): error TS2322: Type 'number' is not assignable to type '[[any]]'. @@ -5,6 +6,7 @@ destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument o Source has 2 element(s) but target requires 3. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringParameterDeclaration3ES5iterable.ts (3 errors) ==== // If the parameter is a rest parameter, the parameter type is any[] // A type annotation for a rest parameter must denote an array type. diff --git a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es5).errors.txt b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es5).errors.txt index deee877920209..02136627c7cac 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration3ES5iterable(target=es5).errors.txt @@ -1,3 +1,4 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. destructuringParameterDeclaration3ES5iterable.ts(26,4): error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. Source has 5 element(s) but target allows only 3. @@ -6,6 +7,7 @@ destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument o Source has 2 element(s) but target requires 3. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringParameterDeclaration3ES5iterable.ts (3 errors) ==== // If the parameter is a rest parameter, the parameter type is any[] diff --git a/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..034f6d5964792 --- /dev/null +++ b/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt @@ -0,0 +1,18 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== destructuringParameterDeclaration7ES5iterable.ts (0 errors) ==== + interface ISomething { + foo: string, + bar: string + } + + function foo({}, {foo, bar}: ISomething) {} + + function baz([], {foo, bar}: ISomething) {} + + function one([], {}) {} + + function two([], [a, b, c]: number[]) {} + \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es5).errors.txt b/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es5).errors.txt index 7c88a6b4faf9b..e439ea275ea30 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration7ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== destructuringParameterDeclaration7ES5iterable.ts (0 errors) ==== interface ISomething { diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.errors.txt b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.errors.txt new file mode 100644 index 0000000000000..6ad9bf068fb7d --- /dev/null +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5iterable.errors.txt @@ -0,0 +1,46 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== destructuringVariableDeclaration1ES5iterable.ts (0 errors) ==== + // The type T associated with a destructuring variable declaration is determined as follows: + // If the declaration includes a type annotation, T is that type. + var {a1, a2}: { a1: number, a2: string } = { a1: 10, a2: "world" } + var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; + + // The type T associated with a destructuring variable declaration is determined as follows: + // Otherwise, if the declaration includes an initializer expression, T is the type of that initializer expression. + var { b1: { b11 } = { b11: "string" } } = { b1: { b11: "world" } }; + var temp = { t1: true, t2: "false" }; + var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; + var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; + + // The type T associated with a binding element is determined as follows: + // If the binding element is a rest element, T is an array type with + // an element type E, where E is the type of the numeric index signature of S. + var [...c1] = [1,2,3]; + var [...c2] = [1,2,3, "string"]; + + // The type T associated with a binding element is determined as follows: + // Otherwise, if S is a tuple- like type (section 3.3.3): + // Let N be the zero-based index of the binding element in the array binding pattern. + // If S has a property with the numerical name N, T is the type of that property. + var [d1,d2] = [1,"string"] + + // The type T associated with a binding element is determined as follows: + // Otherwise, if S is a tuple- like type (section 3.3.3): + // Otherwise, if S has a numeric index signature, T is the type of the numeric index signature. + var temp1 = [true, false, true] + var [d3, d4] = [1, "string", ...temp1]; + + // Combining both forms of destructuring, + var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; + var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; + + // When a destructuring variable declaration, binding property, or binding element specifies + // an initializer expression, the type of the initializer expression is required to be assignable + // to the widened form of the type associated with the destructuring variable declaration, binding property, or binding element. + var {g: {g1 = [undefined, null]}}: { g: { g1: any[] } } = { g: { g1: [1, 2] } }; + var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; + + \ No newline at end of file diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..0f8af2344f6ab --- /dev/null +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== emptyAssignmentPatterns01_ES5iterable.ts (0 errors) ==== + var a: any; + + ({} = a); + ([] = a); \ No newline at end of file diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).types b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).types index d0ab4075e0bb0..9cf5073458c2f 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).types +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es2015).types @@ -3,18 +3,25 @@ === emptyAssignmentPatterns01_ES5iterable.ts === var a: any; >a : any +> : ^^^ ({} = a); >({} = a) : any +> : ^^^ >{} = a : any +> : ^^^ >{} : {} > : ^^ >a : any +> : ^^^ ([] = a); >([] = a) : any +> : ^^^ >[] = a : any +> : ^^^ >[] : [] > : ^^ >a : any +> : ^^^ diff --git a/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).errors.txt index 3217839fcf2ac..debf62091e777 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyAssignmentPatterns01_ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyAssignmentPatterns01_ES5iterable.ts (0 errors) ==== var a: any; diff --git a/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..1d04ecb6dadf8 --- /dev/null +++ b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,10 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== emptyAssignmentPatterns02_ES5iterable.ts (0 errors) ==== + var a: any; + let x, y, z, a1, a2, a3; + + ({} = { x, y, z } = a); + ([] = [ a1, a2, a3] = a); \ No newline at end of file diff --git a/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).types b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).types index 5f60d84bd2010..d45617b53e7ad 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).types +++ b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es2015).types @@ -3,38 +3,59 @@ === emptyAssignmentPatterns02_ES5iterable.ts === var a: any; >a : any +> : ^^^ let x, y, z, a1, a2, a3; >x : any +> : ^^^ >y : any +> : ^^^ >z : any +> : ^^^ >a1 : any +> : ^^^ >a2 : any +> : ^^^ >a3 : any +> : ^^^ ({} = { x, y, z } = a); >({} = { x, y, z } = a) : any +> : ^^^ >{} = { x, y, z } = a : any +> : ^^^ >{} : {} > : ^^ >{ x, y, z } = a : any +> : ^^^ >{ x, y, z } : { x: any; y: any; z: any; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >y : any +> : ^^^ >z : any +> : ^^^ >a : any +> : ^^^ ([] = [ a1, a2, a3] = a); >([] = [ a1, a2, a3] = a) : any +> : ^^^ >[] = [ a1, a2, a3] = a : any +> : ^^^ >[] : [] > : ^^ >[ a1, a2, a3] = a : any +> : ^^^ >[ a1, a2, a3] : [any, any, any] > : ^^^^^^^^^^^^^^^ >a1 : any +> : ^^^ >a2 : any +> : ^^^ >a3 : any +> : ^^^ >a : any +> : ^^^ diff --git a/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).errors.txt index b5356bc044dec..b1b8f95321e7d 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyAssignmentPatterns02_ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyAssignmentPatterns02_ES5iterable.ts (0 errors) ==== var a: any; diff --git a/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..0b879ce2ce876 --- /dev/null +++ b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== emptyAssignmentPatterns03_ES5iterable.ts (0 errors) ==== + var a: any; + + ({} = {} = a); + ([] = [] = a); \ No newline at end of file diff --git a/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).types b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).types index 5e179ddffd63a..96ac327a70b5b 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).types +++ b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es2015).types @@ -3,24 +3,33 @@ === emptyAssignmentPatterns03_ES5iterable.ts === var a: any; >a : any +> : ^^^ ({} = {} = a); >({} = {} = a) : any +> : ^^^ >{} = {} = a : any +> : ^^^ >{} : {} > : ^^ >{} = a : any +> : ^^^ >{} : {} > : ^^ >a : any +> : ^^^ ([] = [] = a); >([] = [] = a) : any +> : ^^^ >[] = [] = a : any +> : ^^^ >[] : [] > : ^^ >[] = a : any +> : ^^^ >[] : [] > : ^^ >a : any +> : ^^^ diff --git a/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).errors.txt index 3b8bb73163395..a08f7b178bbec 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyAssignmentPatterns03_ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyAssignmentPatterns03_ES5iterable.ts (0 errors) ==== var a: any; diff --git a/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..fc7e4f5863440 --- /dev/null +++ b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,10 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== emptyAssignmentPatterns04_ES5iterable.ts (0 errors) ==== + var a: any; + let x, y, z, a1, a2, a3; + + ({ x, y, z } = {} = a); + ([ a1, a2, a3] = [] = a); \ No newline at end of file diff --git a/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).types b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).types index 54f80a5d12806..dd2706117c674 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).types +++ b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es2015).types @@ -3,38 +3,59 @@ === emptyAssignmentPatterns04_ES5iterable.ts === var a: any; >a : any +> : ^^^ let x, y, z, a1, a2, a3; >x : any +> : ^^^ >y : any +> : ^^^ >z : any +> : ^^^ >a1 : any +> : ^^^ >a2 : any +> : ^^^ >a3 : any +> : ^^^ ({ x, y, z } = {} = a); >({ x, y, z } = {} = a) : any +> : ^^^ >{ x, y, z } = {} = a : any +> : ^^^ >{ x, y, z } : { x: any; y: any; z: any; } > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : any +> : ^^^ >y : any +> : ^^^ >z : any +> : ^^^ >{} = a : any +> : ^^^ >{} : {} > : ^^ >a : any +> : ^^^ ([ a1, a2, a3] = [] = a); >([ a1, a2, a3] = [] = a) : any +> : ^^^ >[ a1, a2, a3] = [] = a : any +> : ^^^ >[ a1, a2, a3] : [any, any, any] > : ^^^^^^^^^^^^^^^ >a1 : any +> : ^^^ >a2 : any +> : ^^^ >a3 : any +> : ^^^ >[] = a : any +> : ^^^ >[] : [] > : ^^ >a : any +> : ^^^ diff --git a/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).errors.txt index 793df6c799a41..342dec23590b1 100644 --- a/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyAssignmentPatterns04_ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyAssignmentPatterns04_ES5iterable.ts (0 errors) ==== var a: any; diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt new file mode 100644 index 0000000000000..870660ca251a8 --- /dev/null +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,53 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts (0 errors) ==== + (function () { + var a: any; + + var {} = a; + let {} = a; + const {} = a; + + var [] = a; + let [] = a; + const [] = a; + + var {} = a, [] = a; + let {} = a, [] = a; + const {} = a, [] = a; + + var { p1: {}, p2: [] } = a; + let { p1: {}, p2: [] } = a; + const { p1: {}, p2: [] } = a; + + for (var {} = {}, {} = {}; false; void 0) { + } + + function f({} = a, [] = a, { p: {} = a} = a) { + return ({} = a, [] = a, { p: {} = a } = a) => a; + } + })(); + + (function () { + const ns: number[][] = []; + + for (var {} of ns) { + } + + for (let {} of ns) { + } + + for (const {} of ns) { + } + + for (var [] of ns) { + } + + for (let [] of ns) { + } + + for (const [] of ns) { + } + })(); \ No newline at end of file diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types index 1f5357158a96d..c507b17aeaea8 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types @@ -11,36 +11,49 @@ var a: any; >a : any +> : ^^^ var {} = a; >a : any +> : ^^^ let {} = a; >a : any +> : ^^^ const {} = a; >a : any +> : ^^^ var [] = a; >a : any +> : ^^^ let [] = a; >a : any +> : ^^^ const [] = a; >a : any +> : ^^^ var {} = a, [] = a; >a : any +> : ^^^ >a : any +> : ^^^ let {} = a, [] = a; >a : any +> : ^^^ >a : any +> : ^^^ const {} = a, [] = a; >a : any +> : ^^^ >a : any +> : ^^^ var { p1: {}, p2: [] } = a; >p1 : any @@ -48,6 +61,7 @@ >p2 : any > : ^^^ >a : any +> : ^^^ let { p1: {}, p2: [] } = a; >p1 : any @@ -55,6 +69,7 @@ >p2 : any > : ^^^ >a : any +> : ^^^ const { p1: {}, p2: [] } = a; >p1 : any @@ -62,6 +77,7 @@ >p2 : any > : ^^^ >a : any +> : ^^^ for (var {} = {}, {} = {}; false; void 0) { >{} : {} @@ -80,24 +96,31 @@ >f : ({}?: any, []?: any, { p: {} }?: any) => ({}?: any, []?: any, { p: {} }?: any) => any > : ^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ >p : any > : ^^^ >a : any > : ^^^ >a : any +> : ^^^ return ({} = a, [] = a, { p: {} = a } = a) => a; >({} = a, [] = a, { p: {} = a } = a) => a : ({}?: any, []?: any, { p: {} }?: any) => any > : ^ ^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^^^^^ >a : any +> : ^^^ >a : any +> : ^^^ >p : any > : ^^^ >a : any > : ^^^ >a : any +> : ^^^ >a : any +> : ^^^ } })(); diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).errors.txt index 807cc51852601..df17b21a24d2b 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts (0 errors) ==== (function () { diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt index 2ab84a97c0991..6bb28936d6466 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt @@ -1,3 +1,4 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(2,9): error TS1182: A destructuring declaration must have an initializer. emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(3,9): error TS1182: A destructuring declaration must have an initializer. emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(4,11): error TS1182: A destructuring declaration must have an initializer. @@ -6,6 +7,7 @@ emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(7,9): error TS1182: A d emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(8,11): error TS1182: A destructuring declaration must have an initializer. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts (6 errors) ==== (function () { var {}; diff --git a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es5).errors.txt b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es5).errors.txt index fa976c15cb5b0..3d4eface08386 100644 --- a/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es5).errors.txt +++ b/tests/baselines/reference/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es5).errors.txt @@ -1,3 +1,4 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(2,9): error TS1182: A destructuring declaration must have an initializer. emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(3,9): error TS1182: A destructuring declaration must have an initializer. @@ -7,6 +8,7 @@ emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(7,9): error TS1182: A d emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(8,11): error TS1182: A destructuring declaration must have an initializer. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts (6 errors) ==== (function () { diff --git a/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt b/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt new file mode 100644 index 0000000000000..7f97859641166 --- /dev/null +++ b/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt @@ -0,0 +1,29 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== forAwaitPerIterationBindingDownlevel.ts (0 errors) ==== + const sleep = (tm: number) => new Promise(resolve => setTimeout(resolve, tm)); + + async function* gen() { + yield 1; + await sleep(1000); + yield 2; + } + + const log = console.log; + + (async () => { + for await (const outer of gen()) { + log(`I'm loop ${outer}`); + (async () => { + const inner = outer; + await sleep(2000); + if (inner === outer) { + log(`I'm loop ${inner} and I know I'm loop ${outer}`); + } else { + log(`I'm loop ${inner}, but I think I'm loop ${outer}`); + } + })(); + } + })(); \ No newline at end of file diff --git a/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es5).errors.txt b/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es5).errors.txt index 9bd3b4ee16dc2..5517fb5217713 100644 --- a/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es5).errors.txt +++ b/tests/baselines/reference/forAwaitPerIterationBindingDownlevel(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== forAwaitPerIterationBindingDownlevel.ts (0 errors) ==== const sleep = (tm: number) => new Promise(resolve => setTimeout(resolve, tm)); diff --git a/tests/baselines/reference/restParameterInDownlevelGenerator(target=es2015).errors.txt b/tests/baselines/reference/restParameterInDownlevelGenerator(target=es2015).errors.txt new file mode 100644 index 0000000000000..02b8b911ebdd1 --- /dev/null +++ b/tests/baselines/reference/restParameterInDownlevelGenerator(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== restParameterInDownlevelGenerator.ts (0 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/30653 + function * mergeStringLists(...strings: string[]) { + for (var str of strings); + } \ No newline at end of file diff --git a/tests/baselines/reference/restParameterInDownlevelGenerator(target=es5).errors.txt b/tests/baselines/reference/restParameterInDownlevelGenerator(target=es5).errors.txt index b857bf602e71a..fedbbfd4b672e 100644 --- a/tests/baselines/reference/restParameterInDownlevelGenerator(target=es5).errors.txt +++ b/tests/baselines/reference/restParameterInDownlevelGenerator(target=es5).errors.txt @@ -1,6 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. !!! error TS5107: Option 'target=ES5' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ==== restParameterInDownlevelGenerator.ts (0 errors) ==== // https://github.com/Microsoft/TypeScript/issues/30653 diff --git a/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.errors.txt b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.errors.txt new file mode 100644 index 0000000000000..61cdd482d1629 --- /dev/null +++ b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.errors.txt @@ -0,0 +1,8 @@ +error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. + + +!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. +==== sourceMapValidationVarInDownLevelGenerator.ts (0 errors) ==== + function * f() { + var x = 1, y; + } \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types index 614980e941b2f..0ea6ff9b07f35 100644 --- a/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types +++ b/tests/baselines/reference/sourceMapValidationVarInDownLevelGenerator.types @@ -11,4 +11,5 @@ function * f() { >1 : 1 > : ^ >y : any +> : ^^^ }