diff --git a/internal/checker/checker.go b/internal/checker/checker.go index cf0a0622f7f..2fbd2e78bad 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -5910,17 +5910,10 @@ func (c *Checker) getIteratedTypeOrElementType(use IterationUse, inputType *Type } return nil } - // TODO: remove ScriptTargetES2015 iterableExists := c.getGlobalIterableType() != c.emptyGenericType - uplevelIteration := c.languageVersion >= core.ScriptTargetES2015 && iterableExists - downlevelIteration := !uplevelIteration && c.compilerOptions.DownlevelIteration == core.TSTrue possibleOutOfBounds := c.compilerOptions.NoUncheckedIndexedAccess == core.TSTrue && use&IterationUsePossiblyOutOfBounds != 0 - // Get the iterated type of an `Iterable` or `IterableIterator` only in ES2015 - // or higher, when inside of an async generator or for-await-if, or when - // downlevelIteration is requested. - if uplevelIteration || downlevelIteration || allowAsyncIterables { - // We only report errors for an invalid iterable type in ES2015 or higher. - iterationTypes := c.getIterationTypesOfIterable(inputType, use, core.IfElse(uplevelIteration, errorNode, nil)) + if iterableExists || allowAsyncIterables { + iterationTypes := c.getIterationTypesOfIterable(inputType, use, core.IfElse(iterableExists, errorNode, nil)) if checkAssignability { if iterationTypes.nextType != nil { var diagnostic *diagnostics.Message @@ -5939,7 +5932,7 @@ func (c *Checker) getIteratedTypeOrElementType(use IterationUse, inputType *Type } } } - if iterationTypes.yieldType != nil || uplevelIteration { + if iterationTypes.yieldType != nil || iterableExists { if iterationTypes.yieldType == nil { return nil } @@ -5988,7 +5981,7 @@ func (c *Checker) getIteratedTypeOrElementType(use IterationUse, inputType *Type // number and string input is allowed, we want to say that number is not an // array type or a string type. allowsStrings := use&IterationUseAllowsStringInputFlag != 0 && !hasStringConstituent - defaultDiagnostic, maybeMissingAwait := c.getIterationDiagnosticDetails(use, inputType, allowsStrings, downlevelIteration) + defaultDiagnostic, maybeMissingAwait := c.getIterationDiagnosticDetails(use, inputType, allowsStrings) c.errorAndMaybeSuggestAwait(errorNode, maybeMissingAwait && c.getAwaitedTypeOfPromise(arrayType) != nil, defaultDiagnostic, c.TypeToString(arrayType)) } if hasStringConstituent { @@ -6490,13 +6483,7 @@ func (c *Checker) reportTypeNotIterableError(errorNode *ast.Node, t *Type, allow return c.errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, c.TypeToString(t)) } -func (c *Checker) getIterationDiagnosticDetails(use IterationUse, inputType *Type, allowsStrings bool, downlevelIteration bool) (*diagnostics.Message, bool) { - if downlevelIteration { - if allowsStrings { - return diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true - } - return diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator, true - } +func (c *Checker) getIterationDiagnosticDetails(use IterationUse, inputType *Type, allowsStrings bool) (*diagnostics.Message, bool) { yieldType := c.getIterationTypeOfIterable(use, IterationTypeKindYield, inputType, nil /*errorNode*/) if yieldType != nil { return diagnostics.Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher, false diff --git a/internal/compiler/program.go b/internal/compiler/program.go index e0fe053c000..1c77f8e058a 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -696,6 +696,10 @@ func (p *Program) verifyCompilerOptions() { createRemovedOptionDiagnostic("allowSyntheticDefaultImports", "false", "") } + if !options.DownlevelIteration.IsUnknown() { + createRemovedOptionDiagnostic("downlevelIteration", "", "") + } + if options.StrictPropertyInitialization.IsTrue() && !options.GetStrictOptionValue(options.StrictNullChecks) { createDiagnosticForOptionName(diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "strictPropertyInitialization", "strictNullChecks") } diff --git a/internal/core/compileroptions.go b/internal/core/compileroptions.go index d4c67103374..1a7c2483a2b 100644 --- a/internal/core/compileroptions.go +++ b/internal/core/compileroptions.go @@ -29,7 +29,6 @@ type CompilerOptions struct { EmitDeclarationOnly Tristate `json:"emitDeclarationOnly,omitzero"` EmitBOM Tristate `json:"emitBOM,omitzero"` EmitDecoratorMetadata Tristate `json:"emitDecoratorMetadata,omitzero"` - DownlevelIteration Tristate `json:"downlevelIteration,omitzero"` Declaration Tristate `json:"declaration,omitzero"` DeclarationDir string `json:"declarationDir,omitzero"` DeclarationMap Tristate `json:"declarationMap,omitzero"` @@ -124,6 +123,8 @@ type CompilerOptions struct { // Deprecated: Do not use outside of options parsing and validation. BaseUrl string `json:"baseUrl,omitzero"` // Deprecated: Do not use outside of options parsing and validation. + DownlevelIteration Tristate `json:"downlevelIteration,omitzero"` + // Deprecated: Do not use outside of options parsing and validation. ESModuleInterop Tristate `json:"esModuleInterop,omitzero"` // Deprecated: Do not use outside of options parsing and validation. OutFile string `json:"outFile,omitzero"` diff --git a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt new file mode 100644 index 00000000000..0fa9eddb6be --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt @@ -0,0 +1,11 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff index 446806920e0..feef6a586ff 100644 --- a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff @@ -5,11 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== blockScopedBindingsInDownlevelGenerator.ts (0 errors) ==== + function* a() { + for (const i of [1,2,3]) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt new file mode 100644 index 00000000000..13d88112c94 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt @@ -0,0 +1,8 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== sourceMapValidationVarInDownLevelGenerator.ts (0 errors) ==== + function * f() { + var x = 1, y; + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff index 190748a72e4..11bf31c3e9a 100644 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff @@ -5,8 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== sourceMapValidationVarInDownLevelGenerator.ts (0 errors) ==== + function * f() { + var x = 1, y; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt new file mode 100644 index 00000000000..4d4ed0b3934 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt @@ -0,0 +1,8 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== ES5For-of33.ts (0 errors) ==== + for (var v of ['a', 'b', 'c']) { + console.log(v); + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff index 0012287cde6..083f94e7b96 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff @@ -5,8 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== ES5For-of33.ts (0 errors) ==== + for (var v of ['a', 'b', 'c']) { + console.log(v); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt index f144c20c30d..90f82ef8ab7 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of34.ts (1 errors) ==== function foo() { return { x: 0 }; diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff index 0fca10d7c4c..171bb8bbfb0 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff @@ -2,10 +2,12 @@ +++ new.ES5For-of34(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of34.ts (1 errors) ==== function foo() { return { x: 0 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt index 64fe6dcc61a..0e82738d28e 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt @@ -1,7 +1,9 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of35.ts (2 errors) ==== for (const {x: a = 0, y: b = 1} of [2, 3]) { ~ diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff index 4b0627c85c6..a83f8b7c96b 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff @@ -2,11 +2,13 @@ +++ new.ES5For-of35(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of35.ts (2 errors) ==== for (const {x: a = 0, y: b = 1} of [2, 3]) { ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt index c39a271f174..9fab0939bf7 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ES5For-of36.ts(1,10): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of36.ts (1 errors) ==== for (let [a = 0, b = 1] of [2, 3]) { ~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff index 56a07963e64..c557b4d1893 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff @@ -2,10 +2,12 @@ +++ new.ES5For-of36(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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. ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== ES5For-of36.ts (1 errors) ==== for (let [a = 0, b = 1] of [2, 3]) { ~~~~~~~~~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt new file mode 100644 index 00000000000..67562094db1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt @@ -0,0 +1,20 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff index d204ab09b73..be753d3ff33 100644 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff @@ -5,20 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== ES5For-of37.ts (0 errors) ==== + // https://github.com/microsoft/TypeScript/issues/30083 + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..7f70eb7740e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt @@ -0,0 +1,28 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff index cd753d3c2ba..6bf09a5e1bc 100644 --- a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff @@ -5,28 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== arrayLiteralSpreadES5iterable.ts (0 errors) ==== + function f0() { + var a = [1, 2, 3]; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt new file mode 100644 index 00000000000..be39dc96b0c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt @@ -0,0 +1,12 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff index 46c975cdc12..d9135ed5e5c 100644 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff @@ -5,12 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== asyncArrowFunction11_es5.ts (0 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/24722 + class A { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt index 991b50d74cc..6265bfb7810 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@ -1,8 +1,10 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== /* AssignmentPattern: * ObjectAssignmentPattern diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff index 9a5567807bd..4701a179086 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff @@ -2,12 +2,14 @@ +++ new.destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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. ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== /* AssignmentPattern: * ObjectAssignmentPattern \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt index 5bf7d7eb19a..f3581f6522c 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt @@ -1,6 +1,8 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== // #35497 diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff index ee10647a7b6..82b0afd4640 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff @@ -6,13 +6,15 @@ - - -!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. + + ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== // #35497 -@@= skipped -9, +7 lines =@@ +@@= skipped -9, +9 lines =@@ declare const data: number[] | null; const [value] = data; // Error ~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt index 59c0d309e3c..206834b5bbb 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt @@ -1,3 +1,4 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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(23,5): error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type. @@ -62,6 +63,7 @@ destructuringParameterDeclaration1ES5iterable.ts(95,25): error TS7031: Binding e destructuringParameterDeclaration1ES5iterable.ts(95,32): error TS7031: Binding element 'any' implicitly has an 'any' type. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringParameterDeclaration1ES5iterable.ts (60 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/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff index a811afb4a31..46ca81b53e8 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff @@ -2,14 +2,16 @@ +++ new.destructuringParameterDeclaration1ES5iterable.errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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(23,5): error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type. -@@= skipped -62, +61 lines =@@ +@@= skipped -62, +62 lines =@@ destructuringParameterDeclaration1ES5iterable.ts(95,32): error TS7031: Binding element 'any' implicitly has an 'any' type. -!!! error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringParameterDeclaration1ES5iterable.ts (60 errors) ==== // A parameter declaration may specify either an identifier or a binding pattern. // The identifiers specified in parameter declarations and binding patterns \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt index 3162c188f3d..feeb3079131 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt @@ -1,3 +1,4 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. destructuringParameterDeclaration3ES5iterable.ts(12,13): error TS7019: Rest parameter 'a' implicitly has an 'any[]' type. destructuringParameterDeclaration3ES5iterable.ts(16,14): error TS7031: Binding element 'a' implicitly has an 'any' type. destructuringParameterDeclaration3ES5iterable.ts(16,17): error TS7031: Binding element 'b' implicitly has an 'any' type. @@ -13,6 +14,7 @@ destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument o Source has 2 element(s) but target requires 3. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringParameterDeclaration3ES5iterable.ts (11 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/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff index a730dfb6915..8d36661fc34 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff @@ -2,14 +2,16 @@ +++ new.destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. destructuringParameterDeclaration3ES5iterable.ts(12,13): error TS7019: Rest parameter 'a' implicitly has an 'any[]' type. destructuringParameterDeclaration3ES5iterable.ts(16,14): error TS7031: Binding element 'a' implicitly has an 'any' type. destructuringParameterDeclaration3ES5iterable.ts(16,17): error TS7031: Binding element 'b' implicitly has an 'any' type. -@@= skipped -13, +12 lines =@@ +@@= skipped -13, +13 lines =@@ 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringParameterDeclaration3ES5iterable.ts (11 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. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..0f63104912b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt @@ -0,0 +1,18 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff index 76868b483c6..5f35e586c3d 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff @@ -5,18 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== destructuringParameterDeclaration7ES5iterable.ts (0 errors) ==== + interface ISomething { + foo: string, \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt index 499a38d7335..e04ff261042 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt @@ -1,7 +1,9 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. destructuringVariableDeclaration1ES5iterable.ts(39,16): error TS2322: Type 'undefined' is not assignable to type 'number'. destructuringVariableDeclaration1ES5iterable.ts(39,27): error TS2322: Type 'null' is not assignable to type 'number'. +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringVariableDeclaration1ES5iterable.ts (2 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. diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff index d26f12c7093..421d5e05f33 100644 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff @@ -2,11 +2,13 @@ +++ new.destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. destructuringVariableDeclaration1ES5iterable.ts(39,16): error TS2322: Type 'undefined' is not assignable to type 'number'. destructuringVariableDeclaration1ES5iterable.ts(39,27): error TS2322: Type 'null' 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== destructuringVariableDeclaration1ES5iterable.ts (2 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. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..083e1202b16 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== emptyAssignmentPatterns01_ES5iterable.ts (0 errors) ==== + var a: any; + + ({} = a); + ([] = a); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff index 4ec32fb2103..55040842698 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff @@ -5,9 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== emptyAssignmentPatterns01_ES5iterable.ts (0 errors) ==== + var a: any; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..da16f428d73 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,10 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff index 07485e2089d..38909801779 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff @@ -5,10 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== emptyAssignmentPatterns02_ES5iterable.ts (0 errors) ==== + var a: any; + let x, y, z, a1, a2, a3; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..1bdf331b4c7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== emptyAssignmentPatterns03_ES5iterable.ts (0 errors) ==== + var a: any; + + ({} = {} = a); + ([] = [] = a); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff index 8722f619aa8..7477b9e1601 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff @@ -5,9 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== emptyAssignmentPatterns03_ES5iterable.ts (0 errors) ==== + var a: any; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..bd2b7f0c1b4 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,10 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff index 7fdc9d6eec7..43ef9aa6575 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff @@ -5,10 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== emptyAssignmentPatterns04_ES5iterable.ts (0 errors) ==== + var a: any; + let x, y, z, a1, a2, a3; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..011f3c178ce --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,53 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff index ee0d242f175..96b4df48117 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff @@ -5,53 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts (0 errors) ==== + (function () { + var a: any; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt index 2ab84a97c09..59321851b22 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt @@ -1,3 +1,4 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts (6 errors) ==== (function () { var {}; diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff index 66386da6330..18e03a0e413 100644 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff @@ -2,14 +2,16 @@ +++ new.emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ -error TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error. ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. 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. -@@= skipped -6, +5 lines =@@ +@@= skipped -6, +6 lines =@@ 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 TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ==== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts (6 errors) ==== (function () { var {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt new file mode 100644 index 00000000000..9840b03ea42 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt @@ -0,0 +1,29 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff index 24be52271c6..519818c6015 100644 --- a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff @@ -5,29 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== forAwaitPerIterationBindingDownlevel.ts (0 errors) ==== + const sleep = (tm: number) => new Promise(resolve => setTimeout(resolve, tm)); + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt new file mode 100644 index 00000000000..85054b19456 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt @@ -0,0 +1,9 @@ +error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + + +!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. +==== 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/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff index f4957742eda..649f5f6d660 100644 --- a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff @@ -5,9 +5,10 @@ - - -!!! 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 ++error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. ++ ++ ++!!! error TS5102: Option 'downlevelIteration' has been removed. Please remove it from your configuration. + ==== restParameterInDownlevelGenerator.ts (0 errors) ==== + // https://github.com/Microsoft/TypeScript/issues/30653 + function * mergeStringLists(...strings: string[]) { \ No newline at end of file