From 2afc8b479f9a1b1f45657529165ea4d249d2a4d3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Feb 2026 03:33:24 +0000 Subject: [PATCH 1/4] Initial plan From 5f02cfd9e0a55d632be4f91124b147fd9457f1a8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 18 Feb 2026 03:50:01 +0000 Subject: [PATCH 2/4] Add removed diagnostic for downlevelIteration and skip tests with it set Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com> --- internal/compiler/program.go | 4 + internal/testutil/harnessutil/harnessutil.go | 3 + ...elGenerator(target=es2015).errors.txt.diff | 15 - ...ingsInDownlevelGenerator(target=es2015).js | 18 - ...nDownlevelGenerator(target=es2015).symbols | 16 - ...sInDownlevelGenerator(target=es2015).types | 24 - ...elGenerator(target=es2015).errors.txt.diff | 12 - ...nVarInDownLevelGenerator(target=es2015).js | 13 - ...InDownLevelGenerator(target=es2015).js.map | 3 - ...nLevelGenerator(target=es2015).js.map.diff | 8 - ...evelGenerator(target=es2015).sourcemap.txt | 70 --- ...enerator(target=es2015).sourcemap.txt.diff | 46 -- ...nDownLevelGenerator(target=es2015).symbols | 10 - ...rInDownLevelGenerator(target=es2015).types | 11 - ...ES5For-of33(target=es2015).errors.txt.diff | 12 - .../conformance/ES5For-of33(target=es2015).js | 13 - .../ES5For-of33(target=es2015).js.map | 3 - .../ES5For-of33(target=es2015).sourcemap.txt | 93 ---- .../ES5For-of33(target=es2015).symbols | 12 - .../ES5For-of33(target=es2015).types | 17 - .../ES5For-of34(target=es2015).errors.txt | 12 - ...ES5For-of34(target=es2015).errors.txt.diff | 11 - .../conformance/ES5For-of34(target=es2015).js | 19 - .../ES5For-of34(target=es2015).js.map | 3 - .../ES5For-of34(target=es2015).js.map.diff | 8 - .../ES5For-of34(target=es2015).sourcemap.txt | 155 ------- ...For-of34(target=es2015).sourcemap.txt.diff | 42 -- .../ES5For-of34(target=es2015).symbols | 20 - .../ES5For-of34(target=es2015).types | 28 -- .../ES5For-of35(target=es2015).errors.txt | 13 - ...ES5For-of35(target=es2015).errors.txt.diff | 12 - .../conformance/ES5For-of35(target=es2015).js | 15 - .../ES5For-of35(target=es2015).js.map | 3 - .../ES5For-of35(target=es2015).sourcemap.txt | 121 ----- .../ES5For-of35(target=es2015).symbols | 13 - .../ES5For-of35(target=es2015).types | 20 - .../ES5For-of36(target=es2015).errors.txt | 10 - ...ES5For-of36(target=es2015).errors.txt.diff | 11 - .../conformance/ES5For-of36(target=es2015).js | 15 - .../ES5For-of36(target=es2015).js.map | 3 - .../ES5For-of36(target=es2015).sourcemap.txt | 109 ----- .../ES5For-of36(target=es2015).symbols | 13 - .../ES5For-of36(target=es2015).types | 18 - ...ES5For-of37(target=es2015).errors.txt.diff | 24 - .../conformance/ES5For-of37(target=es2015).js | 36 -- .../ES5For-of37(target=es2015).symbols | 37 -- .../ES5For-of37(target=es2015).types | 54 --- ...ES5iterable(target=es2015).errors.txt.diff | 32 -- ...LiteralSpreadES5iterable(target=es2015).js | 49 -- ...alSpreadES5iterable(target=es2015).symbols | 69 --- ...eralSpreadES5iterable(target=es2015).types | 135 ------ ...ction11_es5(target=es2015).errors.txt.diff | 16 - ...asyncArrowFunction11_es5(target=es2015).js | 20 - ...ArrowFunction11_es5(target=es2015).js.diff | 28 -- ...ArrowFunction11_es5(target=es2015).symbols | 24 - ...ncArrowFunction11_es5(target=es2015).types | 29 -- ...atternAndAssignment1ES5iterable.errors.txt | 65 --- ...nAndAssignment1ES5iterable.errors.txt.diff | 13 - ...BindingPatternAndAssignment1ES5iterable.js | 103 ----- ...ngPatternAndAssignment1ES5iterable.symbols | 107 ----- ...dingPatternAndAssignment1ES5iterable.types | 169 ------- ...rnAndAssignment4(target=es2015).errors.txt | 12 - ...Assignment4(target=es2015).errors.txt.diff | 21 - ...ingPatternAndAssignment4(target=es2015).js | 14 - ...tternAndAssignment4(target=es2015).symbols | 13 - ...PatternAndAssignment4(target=es2015).types | 13 - ...rnAndAssignment4(target=es2015).types.diff | 9 - ...arameterDeclaration1ES5iterable.errors.txt | 284 ------------ ...terDeclaration1ES5iterable.errors.txt.diff | 15 - ...cturingParameterDeclaration1ES5iterable.js | 173 ------- ...ngParameterDeclaration1ES5iterable.symbols | 329 ------------- ...ringParameterDeclaration1ES5iterable.types | 431 ------------------ ...arameterDeclaration1ES5iterable.types.diff | 37 -- ...tion3ES5iterable(target=es2015).errors.txt | 85 ---- ...ES5iterable(target=es2015).errors.txt.diff | 15 - ...rDeclaration3ES5iterable(target=es2015).js | 82 ---- ...aration3ES5iterable(target=es2015).symbols | 146 ------ ...claration3ES5iterable(target=es2015).types | 191 -------- ...tion3ES5iterable(target=es2015).types.diff | 28 -- ...ES5iterable(target=es2015).errors.txt.diff | 22 - ...rDeclaration7ES5iterable(target=es2015).js | 23 - ...aration7ES5iterable(target=es2015).symbols | 34 -- ...claration7ES5iterable(target=es2015).types | 30 -- ...tion1ES5iterable(target=es2015).errors.txt | 50 -- ...ES5iterable(target=es2015).errors.txt.diff | 12 - ...eDeclaration1ES5iterable(target=es2015).js | 80 ---- ...aration1ES5iterable(target=es2015).symbols | 122 ----- ...claration1ES5iterable(target=es2015).types | 199 -------- ...ES5iterable(target=es2015).errors.txt.diff | 13 - ...ntPatterns01_ES5iterable(target=es2015).js | 17 - ...terns01_ES5iterable(target=es2015).symbols | 12 - ...atterns01_ES5iterable(target=es2015).types | 18 - ...ES5iterable(target=es2015).errors.txt.diff | 14 - ...ntPatterns02_ES5iterable(target=es2015).js | 20 - ...terns02_ES5iterable(target=es2015).symbols | 26 -- ...atterns02_ES5iterable(target=es2015).types | 36 -- ...ES5iterable(target=es2015).errors.txt.diff | 13 - ...ntPatterns03_ES5iterable(target=es2015).js | 17 - ...terns03_ES5iterable(target=es2015).symbols | 12 - ...atterns03_ES5iterable(target=es2015).types | 22 - ...ES5iterable(target=es2015).errors.txt.diff | 14 - ...ntPatterns04_ES5iterable(target=es2015).js | 20 - ...terns04_ES5iterable(target=es2015).symbols | 26 -- ...atterns04_ES5iterable(target=es2015).types | 36 -- ...ES5iterable(target=es2015).errors.txt.diff | 57 --- ...ngPatterns01_ES5iterable(target=es2015).js | 89 ---- ...terns01_ES5iterable(target=es2015).symbols | 93 ---- ...atterns01_ES5iterable(target=es2015).types | 116 ----- ...ns02_ES5iterable(target=es2015).errors.txt | 30 -- ...ES5iterable(target=es2015).errors.txt.diff | 15 - ...ngPatterns02_ES5iterable(target=es2015).js | 26 -- ...terns02_ES5iterable(target=es2015).symbols | 13 - ...atterns02_ES5iterable(target=es2015).types | 16 - ...ngDownlevel(target=es2015).errors.txt.diff | 33 -- ...terationBindingDownlevel(target=es2015).js | 52 --- ...ionBindingDownlevel(target=es2015).js.diff | 91 ---- ...elGenerator(target=es2015).errors.txt.diff | 13 - ...eterInDownlevelGenerator(target=es2015).js | 15 - ...nDownlevelGenerator(target=es2015).symbols | 12 - ...rInDownlevelGenerator(target=es2015).types | 12 - 120 files changed, 7 insertions(+), 5549 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types delete mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js delete mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols delete mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types diff --git a/internal/compiler/program.go b/internal/compiler/program.go index c46207e545e..c75eb8bb593 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -688,6 +688,10 @@ func (p *Program) verifyCompilerOptions() { createRemovedOptionDiagnostic("alwaysStrict", "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/testutil/harnessutil/harnessutil.go b/internal/testutil/harnessutil/harnessutil.go index 2cdb2a3b150..f76b2737b92 100644 --- a/internal/testutil/harnessutil/harnessutil.go +++ b/internal/testutil/harnessutil/harnessutil.go @@ -1224,6 +1224,9 @@ func SkipUnsupportedCompilerOptions(t *testing.T, options *core.CompilerOptions) if options.OutFile != "" { t.Skipf("unsupported outFile %s", options.OutFile) } + if !options.DownlevelIteration.IsUnknown() { + t.Skipf("unsupported downlevelIteration") + } switch options.Target { case core.ScriptTargetES5: t.Skipf("unsupported target %s", options.Target) 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 deleted file mode 100644 index 446806920e0..00000000000 --- a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt -+++ new.blockScopedBindingsInDownlevelGenerator(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 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/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js deleted file mode 100644 index c9bb7e11f04..00000000000 --- a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// - -//// [blockScopedBindingsInDownlevelGenerator.ts] -function* a() { - for (const i of [1,2,3]) { - (() => i)() - yield i - } -} - -//// [blockScopedBindingsInDownlevelGenerator.js] -"use strict"; -function* a() { - for (const i of [1, 2, 3]) { - (() => i)(); - yield i; - } -} diff --git a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols deleted file mode 100644 index 8b906350c4f..00000000000 --- a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols +++ /dev/null @@ -1,16 +0,0 @@ -//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// - -=== blockScopedBindingsInDownlevelGenerator.ts === -function* a() { ->a : Symbol(a, Decl(blockScopedBindingsInDownlevelGenerator.ts, 0, 0)) - - for (const i of [1,2,3]) { ->i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) - - (() => i)() ->i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) - - yield i ->i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) - } -} diff --git a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types deleted file mode 100644 index 4a4f5ee57e3..00000000000 --- a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types +++ /dev/null @@ -1,24 +0,0 @@ -//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// - -=== blockScopedBindingsInDownlevelGenerator.ts === -function* a() { ->a : () => Generator - - for (const i of [1,2,3]) { ->i : number ->[1,2,3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - - (() => i)() ->(() => i)() : number ->(() => i) : () => number ->() => i : () => number ->i : number - - yield i ->yield i : any ->i : number - } -} 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 deleted file mode 100644 index 190748a72e4..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt -+++ new.sourceMapValidationVarInDownLevelGenerator(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 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/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js deleted file mode 100644 index 372682b45a8..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// - -//// [sourceMapValidationVarInDownLevelGenerator.ts] -function * f() { - var x = 1, y; -} - -//// [sourceMapValidationVarInDownLevelGenerator.js] -"use strict"; -function* f() { - var x = 1, y; -} -//# sourceMappingURL=sourceMapValidationVarInDownLevelGenerator.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map deleted file mode 100644 index d27841fac73..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map +++ /dev/null @@ -1,3 +0,0 @@ -//// [sourceMapValidationVarInDownLevelGenerator.js.map] -{"version":3,"file":"sourceMapValidationVarInDownLevelGenerator.js","sourceRoot":"","sources":["sourceMapValidationVarInDownLevelGenerator.ts"],"names":[],"mappings":";AAAA,QAAS,CAAC,CAAC,CAAC,GAAG;IACX,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAAA,CAChB"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24qIGYoKSB7DQogICAgdmFyIHggPSAxLCB5Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFTLENBQUMsQ0FBQyxDQUFDLEdBQUc7SUFDWCxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQUEsQ0FDaEIifQ==,ZnVuY3Rpb24gKiBmKCkgewogICAgdmFyIHggPSAxLCB5Owp9 diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map.diff deleted file mode 100644 index 4d06748d302..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map -+++ new.sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map -@@= skipped -0, +0 lines =@@ - //// [sourceMapValidationVarInDownLevelGenerator.js.map] --{"version":3,"file":"sourceMapValidationVarInDownLevelGenerator.js","sourceRoot":"","sources":["sourceMapValidationVarInDownLevelGenerator.ts"],"names":[],"mappings":";AAAA,QAAS,CAAC,CAAC,CAAC;IACR,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"} --//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24qIGYoKSB7DQogICAgdmFyIHggPSAxLCB5Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFTLENBQUMsQ0FBQyxDQUFDO0lBQ1IsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNqQixDQUFDIn0=,ZnVuY3Rpb24gKiBmKCkgewogICAgdmFyIHggPSAxLCB5Owp9 -+{"version":3,"file":"sourceMapValidationVarInDownLevelGenerator.js","sourceRoot":"","sources":["sourceMapValidationVarInDownLevelGenerator.ts"],"names":[],"mappings":";AAAA,QAAS,CAAC,CAAC,CAAC,GAAG;IACX,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAAA,CAChB"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24qIGYoKSB7DQogICAgdmFyIHggPSAxLCB5Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFTLENBQUMsQ0FBQyxDQUFDLEdBQUc7SUFDWCxJQUFJLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxDQUFDO0FBQUEsQ0FDaEIifQ==,ZnVuY3Rpb24gKiBmKCkgewogICAgdmFyIHggPSAxLCB5Owp9 \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt deleted file mode 100644 index 97c462a2010..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt +++ /dev/null @@ -1,70 +0,0 @@ -=================================================================== -JsFile: sourceMapValidationVarInDownLevelGenerator.js -mapUrl: sourceMapValidationVarInDownLevelGenerator.js.map -sourceRoot: -sources: sourceMapValidationVarInDownLevelGenerator.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:sourceMapValidationVarInDownLevelGenerator.js -sourceFile:sourceMapValidationVarInDownLevelGenerator.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>function* f() { -1 > -2 >^^^^^^^^ -3 > ^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^^^^-> -1 > -2 >function -3 > * -4 > -5 > f -6 > () -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) -4 >Emitted(2, 11) Source(1, 12) + SourceIndex(0) -5 >Emitted(2, 12) Source(1, 13) + SourceIndex(0) -6 >Emitted(2, 15) Source(1, 16) + SourceIndex(0) ---- ->>> var x = 1, y; -1->^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^^ -7 > ^ -8 > ^ -1->{ - > -2 > var -3 > x -4 > = -5 > 1 -6 > , -7 > y -8 > ; -1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) -3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) -4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) -5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) -6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) -7 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) -8 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 > - >} -1 >Emitted(4, 1) Source(2, 18) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=sourceMapValidationVarInDownLevelGenerator.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt.diff b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt.diff deleted file mode 100644 index f078a379f56..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt.diff +++ /dev/null @@ -1,46 +0,0 @@ ---- old.sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt -+++ new.sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt -@@= skipped -14, +14 lines =@@ - 3 > ^ - 4 > ^ - 5 > ^ --6 > ^^^^^^^-> -+6 > ^^^ -+7 > ^^^^-> - 1 > - 2 >function - 3 > * - 4 > - 5 > f -+6 > () - 1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) - 2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) - 3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) - 4 >Emitted(2, 11) Source(1, 12) + SourceIndex(0) - 5 >Emitted(2, 12) Source(1, 13) + SourceIndex(0) -+6 >Emitted(2, 15) Source(1, 16) + SourceIndex(0) - --- - >>> var x = 1, y; - 1->^^^^ -@@= skipped -21, +24 lines =@@ - 6 > ^^ - 7 > ^ - 8 > ^ --1->() { -+1->{ - > - 2 > var - 3 > x -@@= skipped -23, +23 lines =@@ - 2 >^ - 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> - 1 > -- > --2 >} --1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) -+2 > -+ >} -+1 >Emitted(4, 1) Source(2, 18) + SourceIndex(0) - 2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) - --- - >>>//# sourceMappingURL=sourceMapValidationVarInDownLevelGenerator.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols deleted file mode 100644 index 6398cd2ed41..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols +++ /dev/null @@ -1,10 +0,0 @@ -//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// - -=== sourceMapValidationVarInDownLevelGenerator.ts === -function * f() { ->f : Symbol(f, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 0, 0)) - - var x = 1, y; ->x : Symbol(x, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 1, 7)) ->y : Symbol(y, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 1, 14)) -} diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types deleted file mode 100644 index 7f38ceeb19e..00000000000 --- a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types +++ /dev/null @@ -1,11 +0,0 @@ -//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// - -=== sourceMapValidationVarInDownLevelGenerator.ts === -function * f() { ->f : () => Generator - - var x = 1, y; ->x : number ->1 : 1 ->y : any -} 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 deleted file mode 100644 index 0012287cde6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.ES5For-of33(target=es2015).errors.txt -+++ new.ES5For-of33(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 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/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js deleted file mode 100644 index 72e9e2fc3c8..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// - -//// [ES5For-of33.ts] -for (var v of ['a', 'b', 'c']) { - console.log(v); -} - -//// [ES5For-of33.js] -"use strict"; -for (var v of ['a', 'b', 'c']) { - console.log(v); -} -//# sourceMappingURL=ES5For-of33.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map deleted file mode 100644 index d4a1e2fbc4e..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map +++ /dev/null @@ -1,3 +0,0 @@ -//// [ES5For-of33.js.map] -{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjMzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt deleted file mode 100644 index 7a0d0f21b14..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt +++ /dev/null @@ -1,93 +0,0 @@ -=================================================================== -JsFile: ES5For-of33.js -mapUrl: ES5For-of33.js.map -sourceRoot: -sources: ES5For-of33.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ES5For-of33.js -sourceFile:ES5For-of33.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>for (var v of ['a', 'b', 'c']) { -1 > -2 >^^^^^ -3 > ^^^^ -4 > ^ -5 > ^^^^ -6 > ^ -7 > ^^^ -8 > ^^ -9 > ^^^ -10> ^^ -11> ^^^ -12> ^ -13> ^^ -14> ^ -1 > -2 >for ( -3 > var -4 > v -5 > of -6 > [ -7 > 'a' -8 > , -9 > 'b' -10> , -11> 'c' -12> ] -13> ) -14> { -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) -6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) -7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) -8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) -9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) -10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) -11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) -12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) -13>Emitted(2, 32) Source(1, 32) + SourceIndex(0) -14>Emitted(2, 33) Source(1, 33) + SourceIndex(0) ---- ->>> console.log(v); -1 >^^^^ -2 > ^^^^^^^ -3 > ^ -4 > ^^^ -5 > ^ -6 > ^ -7 > ^ -8 > ^ -1 > - > -2 > console -3 > . -4 > log -5 > ( -6 > v -7 > ) -8 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) -4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) -8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=ES5For-of33.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols deleted file mode 100644 index 6ab34a601a0..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols +++ /dev/null @@ -1,12 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// - -=== ES5For-of33.ts === -for (var v of ['a', 'b', 'c']) { ->v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) - - console.log(v); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types deleted file mode 100644 index 57c9bfc5ac0..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types +++ /dev/null @@ -1,17 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// - -=== ES5For-of33.ts === -for (var v of ['a', 'b', 'c']) { ->v : string ->['a', 'b', 'c'] : string[] ->'a' : "a" ->'b' : "b" ->'c' : "c" - - console.log(v); ->console.log(v) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->v : string -} 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 deleted file mode 100644 index f144c20c30d..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -ES5For-of34.ts(4,6): error TS2322: Type 'string' is not assignable to type 'number'. - - -==== ES5For-of34.ts (1 errors) ==== - function foo() { - return { x: 0 }; - } - for (foo().x of ['a', 'b', 'c']) { - ~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'number'. - var p = foo().x; - } \ No newline at end of file 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 deleted file mode 100644 index 0fca10d7c4c..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.ES5For-of34(target=es2015).errors.txt -+++ 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. - 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 }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js deleted file mode 100644 index 619ce3aea26..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js +++ /dev/null @@ -1,19 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// - -//// [ES5For-of34.ts] -function foo() { - return { x: 0 }; -} -for (foo().x of ['a', 'b', 'c']) { - var p = foo().x; -} - -//// [ES5For-of34.js] -"use strict"; -function foo() { - return { x: 0 }; -} -for (foo().x of ['a', 'b', 'c']) { - var p = foo().x; -} -//# sourceMappingURL=ES5For-of34.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map deleted file mode 100644 index 9ff3295aeef..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map +++ /dev/null @@ -1,3 +0,0 @@ -//// [ES5For-of34.js.map] -{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG,GAAG;IACX,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAAA,CACnB;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsU0FBUyxHQUFHLEdBQUc7SUFDWCxPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDO0FBQUEsQ0FDbkI7QUFDRCxLQUFLLEdBQUcsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM5QixJQUFJLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDcEIsQ0FBQyJ9,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map.diff deleted file mode 100644 index 4225b8e1ecd..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.ES5For-of34(target=es2015).js.map -+++ new.ES5For-of34(target=es2015).js.map -@@= skipped -0, +0 lines =@@ - //// [ES5For-of34.js.map] --{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} --//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDO0FBQ0QsS0FBSyxHQUFHLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFDOUIsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== -+{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG,GAAG;IACX,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAAA,CACnB;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} -+//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsU0FBUyxHQUFHLEdBQUc7SUFDWCxPQUFPLEVBQUUsQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDO0FBQUEsQ0FDbkI7QUFDRCxLQUFLLEdBQUcsRUFBRSxDQUFDLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM5QixJQUFJLENBQUMsR0FBRyxHQUFHLEVBQUUsQ0FBQyxDQUFDLENBQUM7QUFDcEIsQ0FBQyJ9,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt deleted file mode 100644 index ebeaf181f35..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt +++ /dev/null @@ -1,155 +0,0 @@ -=================================================================== -JsFile: ES5For-of34.js -mapUrl: ES5For-of34.js.map -sourceRoot: -sources: ES5For-of34.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ES5For-of34.js -sourceFile:ES5For-of34.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>function foo() { -1 > -2 >^^^^^^^^^ -3 > ^^^ -4 > ^^^ -5 > ^^^^^^-> -1 > -2 >function -3 > foo -4 > () -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) -3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) -4 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) ---- ->>> return { x: 0 }; -1->^^^^ -2 > ^^^^^^^ -3 > ^^ -4 > ^ -5 > ^^ -6 > ^ -7 > ^^ -8 > ^ -1->{ - > -2 > return -3 > { -4 > x -5 > : -6 > 0 -7 > } -8 > ; -1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) -3 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) -4 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) -5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) -6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) -7 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) -8 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > -2 > - >} -1 >Emitted(4, 1) Source(2, 21) + SourceIndex(0) -2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) ---- ->>>for (foo().x of ['a', 'b', 'c']) { -1-> -2 >^^^^^ -3 > ^^^ -4 > ^^ -5 > ^ -6 > ^ -7 > ^^^^ -8 > ^ -9 > ^^^ -10> ^^ -11> ^^^ -12> ^^ -13> ^^^ -14> ^ -15> ^^ -16> ^ -1-> - > -2 >for ( -3 > foo -4 > () -5 > . -6 > x -7 > of -8 > [ -9 > 'a' -10> , -11> 'b' -12> , -13> 'c' -14> ] -15> ) -16> { -1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) -3 >Emitted(5, 9) Source(4, 9) + SourceIndex(0) -4 >Emitted(5, 11) Source(4, 11) + SourceIndex(0) -5 >Emitted(5, 12) Source(4, 12) + SourceIndex(0) -6 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) -7 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) -8 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) -9 >Emitted(5, 21) Source(4, 21) + SourceIndex(0) -10>Emitted(5, 23) Source(4, 23) + SourceIndex(0) -11>Emitted(5, 26) Source(4, 26) + SourceIndex(0) -12>Emitted(5, 28) Source(4, 28) + SourceIndex(0) -13>Emitted(5, 31) Source(4, 31) + SourceIndex(0) -14>Emitted(5, 32) Source(4, 32) + SourceIndex(0) -15>Emitted(5, 34) Source(4, 34) + SourceIndex(0) -16>Emitted(5, 35) Source(4, 35) + SourceIndex(0) ---- ->>> var p = foo().x; -1 >^^^^ -2 > ^^^^ -3 > ^ -4 > ^^^ -5 > ^^^ -6 > ^^ -7 > ^ -8 > ^ -9 > ^ -1 > - > -2 > var -3 > p -4 > = -5 > foo -6 > () -7 > . -8 > x -9 > ; -1 >Emitted(6, 5) Source(5, 5) + SourceIndex(0) -2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) -3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) -4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) -5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) -6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) -7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) -8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) -9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) -2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=ES5For-of34.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt.diff b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt.diff deleted file mode 100644 index 5d29b581ee8..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt.diff +++ /dev/null @@ -1,42 +0,0 @@ ---- old.ES5For-of34(target=es2015).sourcemap.txt -+++ new.ES5For-of34(target=es2015).sourcemap.txt -@@= skipped -12, +12 lines =@@ - 1 > - 2 >^^^^^^^^^ - 3 > ^^^ --4 > ^^^^^^^^^-> -+4 > ^^^ -+5 > ^^^^^^-> - 1 > - 2 >function - 3 > foo -+4 > () - 1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) - 2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) - 3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) -+4 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) - --- - >>> return { x: 0 }; - 1->^^^^ -@@= skipped -17, +20 lines =@@ - 6 > ^ - 7 > ^^ - 8 > ^ --1->() { -+1->{ - > - 2 > return - 3 > { -@@= skipped -23, +23 lines =@@ - 2 >^ - 3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> - 1 > -- > --2 >} --1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) -+2 > -+ >} -+1 >Emitted(4, 1) Source(2, 21) + SourceIndex(0) - 2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) - --- - >>>for (foo().x of ['a', 'b', 'c']) { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols deleted file mode 100644 index 6f167440f88..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// - -=== ES5For-of34.ts === -function foo() { ->foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) - - return { x: 0 }; ->x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) -} -for (foo().x of ['a', 'b', 'c']) { ->foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) ->foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) ->x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) - - var p = foo().x; ->p : Symbol(p, Decl(ES5For-of34.ts, 4, 7)) ->foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) ->foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) ->x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types deleted file mode 100644 index 3756fa5565f..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types +++ /dev/null @@ -1,28 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// - -=== ES5For-of34.ts === -function foo() { ->foo : () => { x: number; } - - return { x: 0 }; ->{ x: 0 } : { x: number; } ->x : number ->0 : 0 -} -for (foo().x of ['a', 'b', 'c']) { ->foo().x : number ->foo() : { x: number; } ->foo : () => { x: number; } ->x : number ->['a', 'b', 'c'] : string[] ->'a' : "a" ->'b' : "b" ->'c' : "c" - - var p = foo().x; ->p : number ->foo().x : number ->foo() : { x: number; } ->foo : () => { x: number; } ->x : number -} 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 deleted file mode 100644 index 64fe6dcc61a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -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'. - - -==== ES5For-of35.ts (2 errors) ==== - for (const {x: a = 0, y: b = 1} of [2, 3]) { - ~ -!!! error TS2339: Property 'x' does not exist on type 'Number'. - ~ -!!! error TS2339: Property 'y' does not exist on type 'Number'. - a; - b; - } \ No newline at end of file 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 deleted file mode 100644 index 4b0627c85c6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.ES5For-of35(target=es2015).errors.txt -+++ 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. - 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]) { - ~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js deleted file mode 100644 index efe54ffb61c..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js +++ /dev/null @@ -1,15 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// - -//// [ES5For-of35.ts] -for (const {x: a = 0, y: b = 1} of [2, 3]) { - a; - b; -} - -//// [ES5For-of35.js] -"use strict"; -for (const { x: a = 0, y: b = 1 } of [2, 3]) { - a; - b; -} -//# sourceMappingURL=ES5For-of35.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map deleted file mode 100644 index 97e36b718a8..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map +++ /dev/null @@ -1,3 +0,0 @@ -//// [ES5For-of35.js.map] -{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";AAAA,KAAK,MAAM,EAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACxC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChjb25zdCB7IHg6IGEgPSAwLCB5OiBiID0gMSB9IG9mIFsyLCAzXSkgew0KICAgIGE7DQogICAgYjsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxNQUFNLEVBQUMsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO0lBQ3hDLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt deleted file mode 100644 index d82f2294f2b..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt +++ /dev/null @@ -1,121 +0,0 @@ -=================================================================== -JsFile: ES5For-of35.js -mapUrl: ES5For-of35.js.map -sourceRoot: -sources: ES5For-of35.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ES5For-of35.js -sourceFile:ES5For-of35.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>for (const { x: a = 0, y: b = 1 } of [2, 3]) { -1 > -2 >^^^^^ -3 > ^^^^^^ -4 > ^^ -5 > ^ -6 > ^^ -7 > ^ -8 > ^^^ -9 > ^ -10> ^^ -11> ^ -12> ^^ -13> ^ -14> ^^^ -15> ^ -16> ^^ -17> ^^^^ -18> ^ -19> ^ -20> ^^ -21> ^ -22> ^ -23> ^^ -24> ^ -1 > -2 >for ( -3 > const -4 > { -5 > x -6 > : -7 > a -8 > = -9 > 0 -10> , -11> y -12> : -13> b -14> = -15> 1 -16> } -17> of -18> [ -19> 2 -20> , -21> 3 -22> ] -23> ) -24> { -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) -4 >Emitted(2, 14) Source(1, 13) + SourceIndex(0) -5 >Emitted(2, 15) Source(1, 14) + SourceIndex(0) -6 >Emitted(2, 17) Source(1, 16) + SourceIndex(0) -7 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) -8 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) -9 >Emitted(2, 22) Source(1, 21) + SourceIndex(0) -10>Emitted(2, 24) Source(1, 23) + SourceIndex(0) -11>Emitted(2, 25) Source(1, 24) + SourceIndex(0) -12>Emitted(2, 27) Source(1, 26) + SourceIndex(0) -13>Emitted(2, 28) Source(1, 27) + SourceIndex(0) -14>Emitted(2, 31) Source(1, 30) + SourceIndex(0) -15>Emitted(2, 32) Source(1, 31) + SourceIndex(0) -16>Emitted(2, 34) Source(1, 32) + SourceIndex(0) -17>Emitted(2, 38) Source(1, 36) + SourceIndex(0) -18>Emitted(2, 39) Source(1, 37) + SourceIndex(0) -19>Emitted(2, 40) Source(1, 38) + SourceIndex(0) -20>Emitted(2, 42) Source(1, 40) + SourceIndex(0) -21>Emitted(2, 43) Source(1, 41) + SourceIndex(0) -22>Emitted(2, 44) Source(1, 42) + SourceIndex(0) -23>Emitted(2, 46) Source(1, 44) + SourceIndex(0) -24>Emitted(2, 47) Source(1, 45) + SourceIndex(0) ---- ->>> a; -1 >^^^^ -2 > ^ -3 > ^ -4 > ^-> -1 > - > -2 > a -3 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) ---- ->>> b; -1->^^^^ -2 > ^ -3 > ^ -1-> - > -2 > b -3 > ; -1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=ES5For-of35.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols deleted file mode 100644 index 8dcd9d0ccdd..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// - -=== ES5For-of35.ts === -for (const {x: a = 0, y: b = 1} of [2, 3]) { ->a : Symbol(a, Decl(ES5For-of35.ts, 0, 12)) ->b : Symbol(b, Decl(ES5For-of35.ts, 0, 21)) - - a; ->a : Symbol(a, Decl(ES5For-of35.ts, 0, 12)) - - b; ->b : Symbol(b, Decl(ES5For-of35.ts, 0, 21)) -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types deleted file mode 100644 index 7df7ab76b24..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// - -=== ES5For-of35.ts === -for (const {x: a = 0, y: b = 1} of [2, 3]) { ->x : any ->a : any ->0 : 0 ->y : any ->b : any ->1 : 1 ->[2, 3] : number[] ->2 : 2 ->3 : 3 - - a; ->a : any - - b; ->b : any -} 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 deleted file mode 100644 index c39a271f174..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -ES5For-of36.ts(1,10): error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator. - - -==== ES5For-of36.ts (1 errors) ==== - for (let [a = 0, b = 1] of [2, 3]) { - ~~~~~~~~~~~~~~ -!!! error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator. - a; - b; - } \ No newline at end of file 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 deleted file mode 100644 index 56a07963e64..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.ES5For-of36(target=es2015).errors.txt -+++ 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. - 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]) { - ~~~~~~~~~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js deleted file mode 100644 index dde2cc8ec54..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js +++ /dev/null @@ -1,15 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// - -//// [ES5For-of36.ts] -for (let [a = 0, b = 1] of [2, 3]) { - a; - b; -} - -//// [ES5For-of36.js] -"use strict"; -for (let [a = 0, b = 1] of [2, 3]) { - a; - b; -} -//# sourceMappingURL=ES5For-of36.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map deleted file mode 100644 index a5125e9ba69..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map +++ /dev/null @@ -1,3 +0,0 @@ -//// [ES5For-of36.js.map] -{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} -//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQztJQUNoQyxDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt deleted file mode 100644 index ee613c44d6d..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt +++ /dev/null @@ -1,109 +0,0 @@ -=================================================================== -JsFile: ES5For-of36.js -mapUrl: ES5For-of36.js.map -sourceRoot: -sources: ES5For-of36.ts -=================================================================== -------------------------------------------------------------------- -emittedFile:ES5For-of36.js -sourceFile:ES5For-of36.ts -------------------------------------------------------------------- ->>>"use strict"; ->>>for (let [a = 0, b = 1] of [2, 3]) { -1 > -2 >^^^^^ -3 > ^^^^ -4 > ^ -5 > ^ -6 > ^^^ -7 > ^ -8 > ^^ -9 > ^ -10> ^^^ -11> ^ -12> ^ -13> ^^^^ -14> ^ -15> ^ -16> ^^ -17> ^ -18> ^ -19> ^^ -20> ^ -1 > -2 >for ( -3 > let -4 > [ -5 > a -6 > = -7 > 0 -8 > , -9 > b -10> = -11> 1 -12> ] -13> of -14> [ -15> 2 -16> , -17> 3 -18> ] -19> ) -20> { -1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) -2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) -3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) -4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) -5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) -6 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) -7 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) -8 >Emitted(2, 18) Source(1, 18) + SourceIndex(0) -9 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) -10>Emitted(2, 22) Source(1, 22) + SourceIndex(0) -11>Emitted(2, 23) Source(1, 23) + SourceIndex(0) -12>Emitted(2, 24) Source(1, 24) + SourceIndex(0) -13>Emitted(2, 28) Source(1, 28) + SourceIndex(0) -14>Emitted(2, 29) Source(1, 29) + SourceIndex(0) -15>Emitted(2, 30) Source(1, 30) + SourceIndex(0) -16>Emitted(2, 32) Source(1, 32) + SourceIndex(0) -17>Emitted(2, 33) Source(1, 33) + SourceIndex(0) -18>Emitted(2, 34) Source(1, 34) + SourceIndex(0) -19>Emitted(2, 36) Source(1, 36) + SourceIndex(0) -20>Emitted(2, 37) Source(1, 37) + SourceIndex(0) ---- ->>> a; -1 >^^^^ -2 > ^ -3 > ^ -4 > ^-> -1 > - > -2 > a -3 > ; -1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) -2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) -3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) ---- ->>> b; -1->^^^^ -2 > ^ -3 > ^ -1-> - > -2 > b -3 > ; -1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) -2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) -3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) ---- ->>>} -1 > -2 >^ -3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> -1 > - > -2 >} -1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) -2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) ---- ->>>//# sourceMappingURL=ES5For-of36.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols deleted file mode 100644 index 5385cfbb0d7..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// - -=== ES5For-of36.ts === -for (let [a = 0, b = 1] of [2, 3]) { ->a : Symbol(a, Decl(ES5For-of36.ts, 0, 10)) ->b : Symbol(b, Decl(ES5For-of36.ts, 0, 16)) - - a; ->a : Symbol(a, Decl(ES5For-of36.ts, 0, 10)) - - b; ->b : Symbol(b, Decl(ES5For-of36.ts, 0, 16)) -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types deleted file mode 100644 index f0530569894..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// - -=== ES5For-of36.ts === -for (let [a = 0, b = 1] of [2, 3]) { ->a : any ->0 : 0 ->b : any ->1 : 1 ->[2, 3] : number[] ->2 : 2 ->3 : 3 - - a; ->a : any - - b; ->b : any -} 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 deleted file mode 100644 index d204ab09b73..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.ES5For-of37(target=es2015).errors.txt -+++ new.ES5For-of37(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 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/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js deleted file mode 100644 index 44111f96ab7..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// - -//// [ES5For-of37.ts] -// 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); - } -} - -//// [ES5For-of37.js] -"use strict"; -// 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); - } -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols deleted file mode 100644 index e23334fe836..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols +++ /dev/null @@ -1,37 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// - -=== ES5For-of37.ts === -// https://github.com/microsoft/TypeScript/issues/30083 - -for (const i of [0, 1, 2, 3, 4]) { ->i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) - - try { - // Ensure catch binding for the following loop is reset per iteration: - for (const j of [1, 2, 3]) { ->j : Symbol(j, Decl(ES5For-of37.ts, 5, 18)) - - if (i === 2) { ->i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) - - throw new Error('ERR'); ->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) - } - } - console.log(i); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) - - } catch (err) { ->err : Symbol(err, Decl(ES5For-of37.ts, 11, 13)) - - console.log('E %s %s', i, err); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) ->i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) ->err : Symbol(err, Decl(ES5For-of37.ts, 11, 13)) - } -} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types deleted file mode 100644 index 26db819c1af..00000000000 --- a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types +++ /dev/null @@ -1,54 +0,0 @@ -//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// - -=== ES5For-of37.ts === -// https://github.com/microsoft/TypeScript/issues/30083 - -for (const i of [0, 1, 2, 3, 4]) { ->i : number ->[0, 1, 2, 3, 4] : number[] ->0 : 0 ->1 : 1 ->2 : 2 ->3 : 3 ->4 : 4 - - try { - // Ensure catch binding for the following loop is reset per iteration: - for (const j of [1, 2, 3]) { ->j : number ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - - if (i === 2) { ->i === 2 : boolean ->i : number ->2 : 2 - - throw new Error('ERR'); ->new Error('ERR') : Error ->Error : ErrorConstructor ->'ERR' : "ERR" - } - } - console.log(i); ->console.log(i) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->i : number - - } catch (err) { ->err : unknown - - console.log('E %s %s', i, err); ->console.log('E %s %s', i, err) : void ->console.log : (...data: any[]) => void ->console : Console ->log : (...data: any[]) => void ->'E %s %s' : "E %s %s" ->i : number ->err : unknown - } -} 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 deleted file mode 100644 index cd753d3c2ba..00000000000 --- a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.arrayLiteralSpreadES5iterable(target=es2015).errors.txt -+++ new.arrayLiteralSpreadES5iterable(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 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/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js deleted file mode 100644 index 22381a7440a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js +++ /dev/null @@ -1,49 +0,0 @@ -//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// - -//// [arrayLiteralSpreadES5iterable.ts] -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]]]]]]; -} - - -//// [arrayLiteralSpreadES5iterable.js] -"use strict"; -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; -} -function f2() { - var a = [...[...[...[...[...[]]]]]]; - var b = [...[...[...[...[...[5]]]]]]; -} diff --git a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols deleted file mode 100644 index 949b2e07217..00000000000 --- a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols +++ /dev/null @@ -1,69 +0,0 @@ -//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// - -=== arrayLiteralSpreadES5iterable.ts === -function f0() { ->f0 : Symbol(f0, Decl(arrayLiteralSpreadES5iterable.ts, 0, 0)) - - var a = [1, 2, 3]; ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a1 = [...a]; ->a1 : Symbol(a1, Decl(arrayLiteralSpreadES5iterable.ts, 2, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a2 = [1, ...a]; ->a2 : Symbol(a2, Decl(arrayLiteralSpreadES5iterable.ts, 3, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a3 = [1, 2, ...a]; ->a3 : Symbol(a3, Decl(arrayLiteralSpreadES5iterable.ts, 4, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a4 = [...a, 1]; ->a4 : Symbol(a4, Decl(arrayLiteralSpreadES5iterable.ts, 5, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a5 = [...a, 1, 2]; ->a5 : Symbol(a5, Decl(arrayLiteralSpreadES5iterable.ts, 6, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a6 = [1, 2, ...a, 1, 2]; ->a6 : Symbol(a6, Decl(arrayLiteralSpreadES5iterable.ts, 7, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a7 = [1, ...a, 2, ...a]; ->a7 : Symbol(a7, Decl(arrayLiteralSpreadES5iterable.ts, 8, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) - - var a8 = [...a, ...a, ...a]; ->a8 : Symbol(a8, Decl(arrayLiteralSpreadES5iterable.ts, 9, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) -} - -function f1() { ->f1 : Symbol(f1, Decl(arrayLiteralSpreadES5iterable.ts, 10, 1)) - - var a = [1, 2, 3]; ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 13, 7)) - - var b = ["hello", ...a, true]; ->b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 14, 7), Decl(arrayLiteralSpreadES5iterable.ts, 15, 7)) ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 13, 7)) - - var b: (string | number | boolean)[]; ->b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 14, 7), Decl(arrayLiteralSpreadES5iterable.ts, 15, 7)) -} - -function f2() { ->f2 : Symbol(f2, Decl(arrayLiteralSpreadES5iterable.ts, 16, 1)) - - var a = [...[...[...[...[...[]]]]]]; ->a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 19, 7)) - - var b = [...[...[...[...[...[5]]]]]]; ->b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 20, 7)) -} - diff --git a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types deleted file mode 100644 index 4967fa77ea9..00000000000 --- a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types +++ /dev/null @@ -1,135 +0,0 @@ -//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// - -=== arrayLiteralSpreadES5iterable.ts === -function f0() { ->f0 : () => void - - var a = [1, 2, 3]; ->a : number[] ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - - var a1 = [...a]; ->a1 : number[] ->[...a] : number[] ->...a : number ->a : number[] - - var a2 = [1, ...a]; ->a2 : number[] ->[1, ...a] : number[] ->1 : 1 ->...a : number ->a : number[] - - var a3 = [1, 2, ...a]; ->a3 : number[] ->[1, 2, ...a] : number[] ->1 : 1 ->2 : 2 ->...a : number ->a : number[] - - var a4 = [...a, 1]; ->a4 : number[] ->[...a, 1] : number[] ->...a : number ->a : number[] ->1 : 1 - - var a5 = [...a, 1, 2]; ->a5 : number[] ->[...a, 1, 2] : number[] ->...a : number ->a : number[] ->1 : 1 ->2 : 2 - - var a6 = [1, 2, ...a, 1, 2]; ->a6 : number[] ->[1, 2, ...a, 1, 2] : number[] ->1 : 1 ->2 : 2 ->...a : number ->a : number[] ->1 : 1 ->2 : 2 - - var a7 = [1, ...a, 2, ...a]; ->a7 : number[] ->[1, ...a, 2, ...a] : number[] ->1 : 1 ->...a : number ->a : number[] ->2 : 2 ->...a : number ->a : number[] - - var a8 = [...a, ...a, ...a]; ->a8 : number[] ->[...a, ...a, ...a] : number[] ->...a : number ->a : number[] ->...a : number ->a : number[] ->...a : number ->a : number[] -} - -function f1() { ->f1 : () => void - - var a = [1, 2, 3]; ->a : number[] ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - - var b = ["hello", ...a, true]; ->b : (string | number | boolean)[] ->["hello", ...a, true] : (string | number | boolean)[] ->"hello" : "hello" ->...a : number ->a : number[] ->true : true - - var b: (string | number | boolean)[]; ->b : (string | number | boolean)[] -} - -function f2() { ->f2 : () => void - - var a = [...[...[...[...[...[]]]]]]; ->a : any[] ->[...[...[...[...[...[]]]]]] : undefined[] ->...[...[...[...[...[]]]]] : undefined ->[...[...[...[...[]]]]] : undefined[] ->...[...[...[...[]]]] : undefined ->[...[...[...[]]]] : undefined[] ->...[...[...[]]] : undefined ->[...[...[]]] : undefined[] ->...[...[]] : undefined ->[...[]] : undefined[] ->...[] : undefined ->[] : undefined[] - - var b = [...[...[...[...[...[5]]]]]]; ->b : number[] ->[...[...[...[...[...[5]]]]]] : number[] ->...[...[...[...[...[5]]]]] : number ->[...[...[...[...[5]]]]] : number[] ->...[...[...[...[5]]]] : number ->[...[...[...[5]]]] : number[] ->...[...[...[5]]] : number ->[...[...[5]]] : number[] ->...[...[5]] : number ->[...[5]] : number[] ->...[5] : number ->[5] : number[] ->5 : 5 -} - 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 deleted file mode 100644 index 46c975cdc12..00000000000 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.asyncArrowFunction11_es5(target=es2015).errors.txt -+++ new.asyncArrowFunction11_es5(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 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/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js deleted file mode 100644 index deef0c4915e..00000000000 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// - -//// [asyncArrowFunction11_es5.ts] -// 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 - }; -} - -//// [asyncArrowFunction11_es5.js] -"use strict"; -// https://github.com/Microsoft/TypeScript/issues/24722 -class A { - b = async (...args) => { - await Promise.resolve(); - const obj = { ["a"]: () => this }; // computed property name after `await` triggers case - }; -} diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff deleted file mode 100644 index 7fba1a70d89..00000000000 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff +++ /dev/null @@ -1,28 +0,0 @@ ---- old.asyncArrowFunction11_es5(target=es2015).js -+++ new.asyncArrowFunction11_es5(target=es2015).js -@@= skipped -10, +10 lines =@@ - - //// [asyncArrowFunction11_es5.js] - "use strict"; --var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -- return new (P || (P = Promise))(function (resolve, reject) { -- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -- step((generator = generator.apply(thisArg, _arguments || [])).next()); -- }); --}; - // https://github.com/Microsoft/TypeScript/issues/24722 - class A { -- constructor() { -- this.b = (...args) => __awaiter(this, void 0, void 0, function* () { -- yield Promise.resolve(); -- const obj = { ["a"]: () => this }; // computed property name after `await` triggers case -- }); -- } -+ b = async (...args) => { -+ 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).symbols b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols deleted file mode 100644 index 9485f0a7b30..00000000000 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols +++ /dev/null @@ -1,24 +0,0 @@ -//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// - -=== asyncArrowFunction11_es5.ts === -// https://github.com/Microsoft/TypeScript/issues/24722 -class A { ->A : Symbol(A, Decl(asyncArrowFunction11_es5.ts, 0, 0)) - - b = async (...args: any[]) => { ->b : Symbol(A.b, Decl(asyncArrowFunction11_es5.ts, 1, 9)) ->args : Symbol(args, Decl(asyncArrowFunction11_es5.ts, 2, 15)) - - await Promise.resolve(); ->Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) ->Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) ->resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) - - const obj = { ["a"]: () => this }; // computed property name after `await` triggers case ->obj : Symbol(obj, Decl(asyncArrowFunction11_es5.ts, 4, 13)) ->["a"] : Symbol(["a"], Decl(asyncArrowFunction11_es5.ts, 4, 21)) ->"a" : Symbol(["a"], Decl(asyncArrowFunction11_es5.ts, 4, 21)) ->this : Symbol(A, Decl(asyncArrowFunction11_es5.ts, 0, 0)) - - }; -} diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types deleted file mode 100644 index 3785693ae9a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types +++ /dev/null @@ -1,29 +0,0 @@ -//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// - -=== asyncArrowFunction11_es5.ts === -// https://github.com/Microsoft/TypeScript/issues/24722 -class A { ->A : A - - b = async (...args: any[]) => { ->b : (...args: any[]) => Promise ->async (...args: any[]) => { await Promise.resolve(); const obj = { ["a"]: () => this }; // computed property name after `await` triggers case } : (...args: any[]) => Promise ->args : any[] - - await Promise.resolve(); ->await Promise.resolve() : void ->Promise.resolve() : Promise ->Promise.resolve : { (): Promise; (value: T): Promise>; (value: T | PromiseLike): Promise>; } ->Promise : PromiseConstructor ->resolve : { (): Promise; (value: T): Promise>; (value: T | PromiseLike): Promise>; } - - const obj = { ["a"]: () => this }; // computed property name after `await` triggers case ->obj : { a: () => this; } ->{ ["a"]: () => this } : { a: () => this; } ->["a"] : () => this ->"a" : "a" ->() => this : () => this ->this : this - - }; -} diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt deleted file mode 100644 index 991b50d74cc..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt +++ /dev/null @@ -1,65 +0,0 @@ -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'. - - -==== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== - /* AssignmentPattern: - * ObjectAssignmentPattern - * ArrayAssignmentPattern - * ArrayAssignmentPattern: - * [Elision AssignmentRestElementopt ] - * [AssignmentElementList] - * [AssignmentElementList, Elision AssignmentRestElementopt ] - * AssignmentElementList: - * Elision AssignmentElement - * AssignmentElementList, Elisionopt AssignmentElement - * AssignmentElement: - * LeftHandSideExpression Initialiseropt - * AssignmentPattern Initialiseropt - * AssignmentRestElement: - * ... LeftHandSideExpression - */ - - // In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. - // An expression of type S is considered assignable to an assignment target V if one of the following is true - - // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, - // S is the type Any, or - - var [a0, a1]: any = undefined; - var [a2 = false, a3 = 1]: any = undefined; - - // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, - // S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, - // where N is the numeric index of E in the array assignment pattern, or - var [b0, b1, b2] = [2, 3, 4]; - var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; - - function foo() { - return [1, 2, 3]; - } - - var [b6, b7] = foo(); - var [...b8] = foo(); - - // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. - var temp = [1,2,3] - var [c0, c1] = [...temp]; - var [c2] = []; - ~~ -!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] - ~~ -!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - ~~ -!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. - var [[c5], c6]: [[string|number], boolean] = [[1], true]; - var [, c7] = [1, 2, 3]; - var [,,, c8] = [1, 2, 3, 4]; - var [,,, c9] = [1, 2, 3, 4]; - var [,,,...c10] = [1, 2, 3, 4, "hello"]; - var [c11, c12, ...c13] = [1, 2, "string"]; - var [c14, c15, c16] = [1, 2, "string"]; - - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff deleted file mode 100644 index 9a5567807bd..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt -+++ 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. - 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 \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js deleted file mode 100644 index af3ea7aa075..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js +++ /dev/null @@ -1,103 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// - -//// [destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] -/* AssignmentPattern: - * ObjectAssignmentPattern - * ArrayAssignmentPattern - * ArrayAssignmentPattern: - * [Elision AssignmentRestElementopt ] - * [AssignmentElementList] - * [AssignmentElementList, Elision AssignmentRestElementopt ] - * AssignmentElementList: - * Elision AssignmentElement - * AssignmentElementList, Elisionopt AssignmentElement - * AssignmentElement: - * LeftHandSideExpression Initialiseropt - * AssignmentPattern Initialiseropt - * AssignmentRestElement: - * ... LeftHandSideExpression - */ - -// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. -// An expression of type S is considered assignable to an assignment target V if one of the following is true - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is the type Any, or - -var [a0, a1]: any = undefined; -var [a2 = false, a3 = 1]: any = undefined; - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, -// where N is the numeric index of E in the array assignment pattern, or -var [b0, b1, b2] = [2, 3, 4]; -var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; - -function foo() { - return [1, 2, 3]; -} - -var [b6, b7] = foo(); -var [...b8] = foo(); - -// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. -var temp = [1,2,3] -var [c0, c1] = [...temp]; -var [c2] = []; -var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] -var [[c5], c6]: [[string|number], boolean] = [[1], true]; -var [, c7] = [1, 2, 3]; -var [,,, c8] = [1, 2, 3, 4]; -var [,,, c9] = [1, 2, 3, 4]; -var [,,,...c10] = [1, 2, 3, 4, "hello"]; -var [c11, c12, ...c13] = [1, 2, "string"]; -var [c14, c15, c16] = [1, 2, "string"]; - - - -//// [destructuringArrayBindingPatternAndAssignment1ES5iterable.js] -"use strict"; -/* AssignmentPattern: - * ObjectAssignmentPattern - * ArrayAssignmentPattern - * ArrayAssignmentPattern: - * [Elision AssignmentRestElementopt ] - * [AssignmentElementList] - * [AssignmentElementList, Elision AssignmentRestElementopt ] - * AssignmentElementList: - * Elision AssignmentElement - * AssignmentElementList, Elisionopt AssignmentElement - * AssignmentElement: - * LeftHandSideExpression Initialiseropt - * AssignmentPattern Initialiseropt - * AssignmentRestElement: - * ... LeftHandSideExpression - */ -// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. -// An expression of type S is considered assignable to an assignment target V if one of the following is true -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is the type Any, or -var [a0, a1] = undefined; -var [a2 = false, a3 = 1] = undefined; -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, -// where N is the numeric index of E in the array assignment pattern, or -var [b0, b1, b2] = [2, 3, 4]; -var [b3, b4, b5] = [1, 2, "string"]; -function foo() { - return [1, 2, 3]; -} -var [b6, b7] = foo(); -var [...b8] = foo(); -// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. -var temp = [1, 2, 3]; -var [c0, c1] = [...temp]; -var [c2] = []; -var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]; -var [[c5], c6] = [[1], true]; -var [, c7] = [1, 2, 3]; -var [, , , c8] = [1, 2, 3, 4]; -var [, , , c9] = [1, 2, 3, 4]; -var [, , , ...c10] = [1, 2, 3, 4, "hello"]; -var [c11, c12, ...c13] = [1, 2, "string"]; -var [c14, c15, c16] = [1, 2, "string"]; diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols deleted file mode 100644 index a55d4786324..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols +++ /dev/null @@ -1,107 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// - -=== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts === -/* AssignmentPattern: - * ObjectAssignmentPattern - * ArrayAssignmentPattern - * ArrayAssignmentPattern: - * [Elision AssignmentRestElementopt ] - * [AssignmentElementList] - * [AssignmentElementList, Elision AssignmentRestElementopt ] - * AssignmentElementList: - * Elision AssignmentElement - * AssignmentElementList, Elisionopt AssignmentElement - * AssignmentElement: - * LeftHandSideExpression Initialiseropt - * AssignmentPattern Initialiseropt - * AssignmentRestElement: - * ... LeftHandSideExpression - */ - -// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. -// An expression of type S is considered assignable to an assignment target V if one of the following is true - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is the type Any, or - -var [a0, a1]: any = undefined; ->a0 : Symbol(a0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 23, 5)) ->a1 : Symbol(a1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 23, 8)) ->undefined : Symbol(undefined) - -var [a2 = false, a3 = 1]: any = undefined; ->a2 : Symbol(a2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 24, 5)) ->a3 : Symbol(a3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 24, 16)) ->undefined : Symbol(undefined) - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, -// where N is the numeric index of E in the array assignment pattern, or -var [b0, b1, b2] = [2, 3, 4]; ->b0 : Symbol(b0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 5)) ->b1 : Symbol(b1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 8)) ->b2 : Symbol(b2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 12)) - -var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; ->b3 : Symbol(b3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 5)) ->b4 : Symbol(b4, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 8)) ->b5 : Symbol(b5, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 12)) - -function foo() { ->foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) - - return [1, 2, 3]; -} - -var [b6, b7] = foo(); ->b6 : Symbol(b6, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 36, 5)) ->b7 : Symbol(b7, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 36, 8)) ->foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) - -var [...b8] = foo(); ->b8 : Symbol(b8, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 37, 5)) ->foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) - -// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. -var temp = [1,2,3] ->temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 40, 3)) - -var [c0, c1] = [...temp]; ->c0 : Symbol(c0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 41, 5)) ->c1 : Symbol(c1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 41, 8)) ->temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 40, 3)) - -var [c2] = []; ->c2 : Symbol(c2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 42, 5)) - -var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : Symbol(c3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 43, 7)) ->c4 : Symbol(c4, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 43, 17)) - -var [[c5], c6]: [[string|number], boolean] = [[1], true]; ->c5 : Symbol(c5, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 44, 6)) ->c6 : Symbol(c6, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 44, 10)) - -var [, c7] = [1, 2, 3]; ->c7 : Symbol(c7, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 45, 6)) - -var [,,, c8] = [1, 2, 3, 4]; ->c8 : Symbol(c8, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 46, 8)) - -var [,,, c9] = [1, 2, 3, 4]; ->c9 : Symbol(c9, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 47, 8)) - -var [,,,...c10] = [1, 2, 3, 4, "hello"]; ->c10 : Symbol(c10, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 48, 8)) - -var [c11, c12, ...c13] = [1, 2, "string"]; ->c11 : Symbol(c11, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 5)) ->c12 : Symbol(c12, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 9)) ->c13 : Symbol(c13, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 14)) - -var [c14, c15, c16] = [1, 2, "string"]; ->c14 : Symbol(c14, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 5)) ->c15 : Symbol(c15, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 9)) ->c16 : Symbol(c16, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 14)) - - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types deleted file mode 100644 index e50b1b97b7a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types +++ /dev/null @@ -1,169 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// - -=== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts === -/* AssignmentPattern: - * ObjectAssignmentPattern - * ArrayAssignmentPattern - * ArrayAssignmentPattern: - * [Elision AssignmentRestElementopt ] - * [AssignmentElementList] - * [AssignmentElementList, Elision AssignmentRestElementopt ] - * AssignmentElementList: - * Elision AssignmentElement - * AssignmentElementList, Elisionopt AssignmentElement - * AssignmentElement: - * LeftHandSideExpression Initialiseropt - * AssignmentPattern Initialiseropt - * AssignmentRestElement: - * ... LeftHandSideExpression - */ - -// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. -// An expression of type S is considered assignable to an assignment target V if one of the following is true - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is the type Any, or - -var [a0, a1]: any = undefined; ->a0 : any ->a1 : any ->undefined : undefined - -var [a2 = false, a3 = 1]: any = undefined; ->a2 : any ->false : false ->a3 : any ->1 : 1 ->undefined : undefined - -// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, -// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, -// where N is the numeric index of E in the array assignment pattern, or -var [b0, b1, b2] = [2, 3, 4]; ->b0 : number ->b1 : number ->b2 : number ->[2, 3, 4] : [number, number, number] ->2 : 2 ->3 : 3 ->4 : 4 - -var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; ->b3 : number ->b4 : number ->b5 : string ->[1, 2, "string"] : [number, number, string] ->1 : 1 ->2 : 2 ->"string" : "string" - -function foo() { ->foo : () => number[] - - return [1, 2, 3]; ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 -} - -var [b6, b7] = foo(); ->b6 : number ->b7 : number ->foo() : number[] ->foo : () => number[] - -var [...b8] = foo(); ->b8 : number[] ->foo() : number[] ->foo : () => number[] - -// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. -var temp = [1,2,3] ->temp : number[] ->[1,2,3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - -var [c0, c1] = [...temp]; ->c0 : number ->c1 : number ->[...temp] : number[] ->...temp : number ->temp : number[] - -var [c2] = []; ->c2 : undefined ->[] : [] - -var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : undefined ->c4 : undefined ->[[[]], [[[[]]]]] : [[[]], [[[[]]]]] ->[[]] : [[]] ->[] : [] ->[[[[]]]] : [[[[]]]] ->[[[]]] : [[[]]] ->[[]] : [[]] ->[] : [] - -var [[c5], c6]: [[string|number], boolean] = [[1], true]; ->c5 : string | number ->c6 : boolean ->[[1], true] : [[number], true] ->[1] : [number] ->1 : 1 ->true : true - -var [, c7] = [1, 2, 3]; ->c7 : number ->[1, 2, 3] : [number, number, number] ->1 : 1 ->2 : 2 ->3 : 3 - -var [,,, c8] = [1, 2, 3, 4]; ->c8 : number ->[1, 2, 3, 4] : [number, number, number, number] ->1 : 1 ->2 : 2 ->3 : 3 ->4 : 4 - -var [,,, c9] = [1, 2, 3, 4]; ->c9 : number ->[1, 2, 3, 4] : [number, number, number, number] ->1 : 1 ->2 : 2 ->3 : 3 ->4 : 4 - -var [,,,...c10] = [1, 2, 3, 4, "hello"]; ->c10 : [number, string] ->[1, 2, 3, 4, "hello"] : [number, number, number, number, string] ->1 : 1 ->2 : 2 ->3 : 3 ->4 : 4 ->"hello" : "hello" - -var [c11, c12, ...c13] = [1, 2, "string"]; ->c11 : number ->c12 : number ->c13 : [string] ->[1, 2, "string"] : [number, number, string] ->1 : 1 ->2 : 2 ->"string" : "string" - -var [c14, c15, c16] = [1, 2, "string"]; ->c14 : number ->c15 : number ->c16 : string ->[1, 2, "string"] : [number, number, string] ->1 : 1 ->2 : 2 ->"string" : "string" - - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt deleted file mode 100644 index 5bf7d7eb19a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -destructuringArrayBindingPatternAndAssignment4.ts(5,7): error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. - - -==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== - // #35497 - - - declare const data: number[] | null; - const [value] = data; // Error - ~~~~~~~ -!!! error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. - \ No newline at end of file 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 deleted file mode 100644 index ee10647a7b6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt -+++ new.destructuringArrayBindingPatternAndAssignment4(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. --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(5,7): error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. -+ -+ - ==== destructuringArrayBindingPatternAndAssignment4.ts (1 errors) ==== - // #35497 - -@@= skipped -9, +7 lines =@@ - declare const data: number[] | null; - const [value] = data; // Error - ~~~~~~~ --!!! error TS2488: Type 'number[] | null' must have a '[Symbol.iterator]()' method that returns an iterator. -+!!! error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js deleted file mode 100644 index a8d7f94dd89..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js +++ /dev/null @@ -1,14 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// - -//// [destructuringArrayBindingPatternAndAssignment4.ts] -// #35497 - - -declare const data: number[] | null; -const [value] = data; // Error - - -//// [destructuringArrayBindingPatternAndAssignment4.js] -"use strict"; -// #35497 -const [value] = data; // Error diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols deleted file mode 100644 index 0cf3f1fb1dc..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// - -=== destructuringArrayBindingPatternAndAssignment4.ts === -// #35497 - - -declare const data: number[] | null; ->data : Symbol(data, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 3, 13)) - -const [value] = data; // Error ->value : Symbol(value, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 4, 7)) ->data : Symbol(data, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 3, 13)) - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types deleted file mode 100644 index 50fab237f32..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// - -=== destructuringArrayBindingPatternAndAssignment4.ts === -// #35497 - - -declare const data: number[] | null; ->data : number[] | null - -const [value] = data; // Error ->value : number ->data : number[] | null - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff deleted file mode 100644 index e0be89f5101..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.destructuringArrayBindingPatternAndAssignment4(target=es2015).types -+++ new.destructuringArrayBindingPatternAndAssignment4(target=es2015).types -@@= skipped -7, +7 lines =@@ - >data : number[] | null - - const [value] = data; // Error -->value : any -+>value : number - >data : number[] | null diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt deleted file mode 100644 index 59c0d309e3c..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt +++ /dev/null @@ -1,284 +0,0 @@ -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. -destructuringParameterDeclaration1ES5iterable.ts(23,8): error TS7006: Parameter 'z' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,11): error TS7006: Parameter 'y' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,17): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,20): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,25): error TS7031: Binding element 'p' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,33): error TS7031: Binding element 'q' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(23,36): error TS7031: Binding element 'r' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(29,5): error TS2322: Type 'number' is not assignable to type 'null | undefined'. -destructuringParameterDeclaration1ES5iterable.ts(29,8): error TS2322: Type 'number' is not assignable to type 'null | undefined'. -destructuringParameterDeclaration1ES5iterable.ts(29,11): error TS2322: Type 'number' is not assignable to type 'null | undefined'. -destructuringParameterDeclaration1ES5iterable.ts(30,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. -destructuringParameterDeclaration1ES5iterable.ts(31,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. -destructuringParameterDeclaration1ES5iterable.ts(32,5): error TS2322: Type 'string' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(32,15): error TS2322: Type 'number' is not assignable to type 'null'. -destructuringParameterDeclaration1ES5iterable.ts(32,18): error TS2322: Type 'number' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(33,6): error TS2322: Type 'string' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(33,17): error TS2322: Type 'number' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(33,22): error TS2322: Type 'true' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(33,28): error TS2322: Type 'false' is not assignable to type 'undefined'. -destructuringParameterDeclaration1ES5iterable.ts(38,18): error TS7031: Binding element 'x' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(38,25): error TS7031: Binding element 'j' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(42,14): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(42,17): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(42,22): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(43,14): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(43,17): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(57,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. -destructuringParameterDeclaration1ES5iterable.ts(62,10): error TS2393: Duplicate function implementation. -destructuringParameterDeclaration1ES5iterable.ts(62,13): error TS7006: Parameter 'x' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(63,10): error TS2393: Duplicate function implementation. -destructuringParameterDeclaration1ES5iterable.ts(66,5): error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type. -destructuringParameterDeclaration1ES5iterable.ts(66,9): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(66,12): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(66,15): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(67,5): error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type. -destructuringParameterDeclaration1ES5iterable.ts(67,9): error TS7031: Binding element 'x' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(67,12): error TS7031: Binding element 'y' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(67,15): error TS7031: Binding element 'z' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(68,5): error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type. -destructuringParameterDeclaration1ES5iterable.ts(68,9): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(68,12): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(68,15): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(75,9): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(75,12): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(75,15): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(79,9): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(79,12): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(79,15): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(80,9): error TS7031: Binding element 'x' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(80,12): error TS7031: Binding element 'y' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(80,15): error TS7031: Binding element 'z' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(81,9): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(81,12): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(81,15): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(92,17): error TS7031: Binding element 'number' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(95,18): error TS7031: Binding element 'number' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(95,25): error TS7031: Binding element 'string' implicitly has an 'any' type. -destructuringParameterDeclaration1ES5iterable.ts(95,32): error TS7031: Binding element 'any' implicitly has an 'any' type. - - -==== 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 - // in a parameter list must be unique within that parameter list. - - // If the declaration includes a type annotation, the parameter is of that type - function a1([a, b, [[c]]]: [number, number, string[][]]) { } - function a2(o: { x: number, a: number }) { } - function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; - function a4({x, a}: { x: number, a: number }) { } - - a1([1, 2, [["world"]]]); - a1([1, 2, [["world"]], 3]); - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. -!!! error TS2345: Source has 4 element(s) but target allows only 3. - - // If the declaration includes an initializer expression (which is permitted only - // when the parameter list occurs in conjunction with a function body), - // the parameter type is the widened form (section 3.11) of the type of the initializer expression. - - function b1(z = [undefined, null]) { }; - function b2(z = null, o = { x: 0, y: undefined }) { } - function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } - - interface F1 { - b5(z, y, [, a, b], {p, m: { q, r}}); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type. - ~ -!!! error TS7006: Parameter 'z' implicitly has an 'any' type. - ~ -!!! error TS7006: Parameter 'y' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'p' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'q' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'r' implicitly has an 'any' type. - } - - function b6([a, z, y] = [undefined, null, undefined]) { } - function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } - - b1([1, 2, 3]); // z is widen to the type any[] - ~ -!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. - b2("string", { x: 200, y: "string" }); - ~~~~~~~~ -!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. - b2("string", { x: 200, y: true }); - ~~~~~~~~ -!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. - b6(["string", 1, 2]); // Shouldn't be an error - ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'undefined'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'null'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'undefined'. - b7([["string"], 1, [[true, false]]]); // Shouldn't be an error - ~~~~~~~~ -!!! error TS2322: Type 'string' is not assignable to type 'undefined'. - ~ -!!! error TS2322: Type 'number' is not assignable to type 'undefined'. - ~~~~ -!!! error TS2322: Type 'true' is not assignable to type 'undefined'. - ~~~~~ -!!! error TS2322: Type 'false' is not assignable to type 'undefined'. - - - // If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) - enum Foo { a } - function c0({z: {x, y: {j}}}) { } - ~ -!!! error TS7031: Binding element 'x' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'j' implicitly has an 'any' type. - function c1({z} = { z: 10 }) { } - function c2({z = 10}) { } - function c3({b}: { b: number|string} = { b: "hello" }) { } - function c5([a, b, [[c]]]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - function c6([a, b, [[c=1]]]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - - c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } - c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } - - c1(); // Implied type is {z:number}? - c1({ z: 1 }) // Implied type is {z:number}? - - c2({}); // Implied type is {z?: number} - c2({z:1}); // Implied type is {z?: number} - - c3({ b: 1 }); // Implied type is { b: number|string }. - - c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] - c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. -!!! error TS2345: Source has 5 element(s) but target allows only 3. - - // A parameter can be marked optional by following its name or binding pattern with a question mark (?) - // or by including an initializer. - - function d0(x?) { } - ~~ -!!! error TS2393: Duplicate function implementation. - ~~ -!!! error TS7006: Parameter 'x' implicitly has an 'any' type. - function d0(x = 10) { } - ~~ -!!! error TS2393: Duplicate function implementation. - - interface F2 { - d3([a, b, c]?); - ~~~~~~~~~~~~~~~ -!!! error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type. - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - d4({x, y, z}?); - ~~~~~~~~~~~~~~~ -!!! error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type. - ~ -!!! error TS7031: Binding element 'x' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'y' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'z' implicitly has an 'any' type. - e0([a, b, c]); - ~~~~~~~~~~~~~~ -!!! error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type. - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - } - - class C2 implements F2 { - constructor() { } - d3() { } - d4() { } - e0([a, b, c]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - } - - class C3 implements F2 { - d3([a, b, c]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - d4({x, y, z}) { } - ~ -!!! error TS7031: Binding element 'x' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'y' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'z' implicitly has an 'any' type. - e0([a, b, c]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - } - - - function d5({x, y} = { x: 1, y: 2 }) { } - d5(); // Parameter is optional as its declaration included an initializer - - // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, - // as such annotations would conflict with the already established meaning of colons in object literals. - // Type annotations must instead be written on the top- level parameter declaration - - function e1({x: number}) { } // x has type any NOT number - ~~~~~~ -!!! error TS7031: Binding element 'number' implicitly has an 'any' type. - function e2({x}: { x: number }) { } // x is type number - function e3({x}: { x?: number }) { } // x is an optional with type number - function e4({x: [number,string,any] }) { } // x has type [any, any, any] - ~~~~~~ -!!! error TS7031: Binding element 'number' implicitly has an 'any' type. - ~~~~~~ -!!! error TS7031: Binding element 'string' implicitly has an 'any' type. - ~~~ -!!! error TS7031: Binding element 'any' implicitly has an 'any' type. - function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff deleted file mode 100644 index a811afb4a31..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.destructuringParameterDeclaration1ES5iterable.errors.txt -+++ 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. - 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 =@@ - 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. - ==== 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/destructuringParameterDeclaration1ES5iterable.js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js deleted file mode 100644 index 07e3ef253de..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js +++ /dev/null @@ -1,173 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// - -//// [destructuringParameterDeclaration1ES5iterable.ts] -// A parameter declaration may specify either an identifier or a binding pattern. -// The identifiers specified in parameter declarations and binding patterns -// in a parameter list must be unique within that parameter list. - -// If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]: [number, number, string[][]]) { } -function a2(o: { x: number, a: number }) { } -function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; -function a4({x, a}: { x: number, a: number }) { } - -a1([1, 2, [["world"]]]); -a1([1, 2, [["world"]], 3]); - -// If the declaration includes an initializer expression (which is permitted only -// when the parameter list occurs in conjunction with a function body), -// the parameter type is the widened form (section 3.11) of the type of the initializer expression. - -function b1(z = [undefined, null]) { }; -function b2(z = null, o = { x: 0, y: undefined }) { } -function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } - -interface F1 { - b5(z, y, [, a, b], {p, m: { q, r}}); -} - -function b6([a, z, y] = [undefined, null, undefined]) { } -function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } - -b1([1, 2, 3]); // z is widen to the type any[] -b2("string", { x: 200, y: "string" }); -b2("string", { x: 200, y: true }); -b6(["string", 1, 2]); // Shouldn't be an error -b7([["string"], 1, [[true, false]]]); // Shouldn't be an error - - -// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) -enum Foo { a } -function c0({z: {x, y: {j}}}) { } -function c1({z} = { z: 10 }) { } -function c2({z = 10}) { } -function c3({b}: { b: number|string} = { b: "hello" }) { } -function c5([a, b, [[c]]]) { } -function c6([a, b, [[c=1]]]) { } - -c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } -c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } - -c1(); // Implied type is {z:number}? -c1({ z: 1 }) // Implied type is {z:number}? - -c2({}); // Implied type is {z?: number} -c2({z:1}); // Implied type is {z?: number} - -c3({ b: 1 }); // Implied type is { b: number|string }. - -c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] -c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] - -// A parameter can be marked optional by following its name or binding pattern with a question mark (?) -// or by including an initializer. - -function d0(x?) { } -function d0(x = 10) { } - -interface F2 { - d3([a, b, c]?); - d4({x, y, z}?); - e0([a, b, c]); -} - -class C2 implements F2 { - constructor() { } - d3() { } - d4() { } - e0([a, b, c]) { } -} - -class C3 implements F2 { - d3([a, b, c]) { } - d4({x, y, z}) { } - e0([a, b, c]) { } -} - - -function d5({x, y} = { x: 1, y: 2 }) { } -d5(); // Parameter is optional as its declaration included an initializer - -// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, -// as such annotations would conflict with the already established meaning of colons in object literals. -// Type annotations must instead be written on the top- level parameter declaration - -function e1({x: number}) { } // x has type any NOT number -function e2({x}: { x: number }) { } // x is type number -function e3({x}: { x?: number }) { } // x is an optional with type number -function e4({x: [number,string,any] }) { } // x has type [any, any, any] -function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] - - -//// [destructuringParameterDeclaration1ES5iterable.js] -"use strict"; -// A parameter declaration may specify either an identifier or a binding pattern. -// The identifiers specified in parameter declarations and binding patterns -// in a parameter list must be unique within that parameter list. -// If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]) { } -function a2(o) { } -function a3({ j, k, l: { m, n }, q: [a, b, c] }) { } -; -function a4({ x, a }) { } -a1([1, 2, [["world"]]]); -a1([1, 2, [["world"]], 3]); -// If the declaration includes an initializer expression (which is permitted only -// when the parameter list occurs in conjunction with a function body), -// the parameter type is the widened form (section 3.11) of the type of the initializer expression. -function b1(z = [undefined, null]) { } -; -function b2(z = null, o = { x: 0, y: undefined }) { } -function b3({ z: { x, y: { j } } } = { z: { x: "hi", y: { j: 1 } } }) { } -function b6([a, z, y] = [undefined, null, undefined]) { } -function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } -b1([1, 2, 3]); // z is widen to the type any[] -b2("string", { x: 200, y: "string" }); -b2("string", { x: 200, y: true }); -b6(["string", 1, 2]); // Shouldn't be an error -b7([["string"], 1, [[true, false]]]); // Shouldn't be an error -// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) -var Foo; -(function (Foo) { - Foo[Foo["a"] = 0] = "a"; -})(Foo || (Foo = {})); -function c0({ z: { x, y: { j } } }) { } -function c1({ z } = { z: 10 }) { } -function c2({ z = 10 }) { } -function c3({ b } = { b: "hello" }) { } -function c5([a, b, [[c]]]) { } -function c6([a, b, [[c = 1]]]) { } -c0({ z: { x: 1, y: { j: "world" } } }); // Implied type is { z: {x: any, y: {j: any}} } -c0({ z: { x: "string", y: { j: true } } }); // Implied type is { z: {x: any, y: {j: any}} } -c1(); // Implied type is {z:number}? -c1({ z: 1 }); // Implied type is {z:number}? -c2({}); // Implied type is {z?: number} -c2({ z: 1 }); // Implied type is {z?: number} -c3({ b: 1 }); // Implied type is { b: number|string }. -c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] -c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] -// A parameter can be marked optional by following its name or binding pattern with a question mark (?) -// or by including an initializer. -function d0(x) { } -function d0(x = 10) { } -class C2 { - constructor() { } - d3() { } - d4() { } - e0([a, b, c]) { } -} -class C3 { - d3([a, b, c]) { } - d4({ x, y, z }) { } - e0([a, b, c]) { } -} -function d5({ x, y } = { x: 1, y: 2 }) { } -d5(); // Parameter is optional as its declaration included an initializer -// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, -// as such annotations would conflict with the already established meaning of colons in object literals. -// Type annotations must instead be written on the top- level parameter declaration -function e1({ x: number }) { } // x has type any NOT number -function e2({ x }) { } // x is type number -function e3({ x }) { } // x is an optional with type number -function e4({ x: [number, string, any] }) { } // x has type [any, any, any] -function e5({ x: [a, b, c] }) { } // x has type [any, any, any] diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols deleted file mode 100644 index 3f733d683d9..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols +++ /dev/null @@ -1,329 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// - -=== destructuringParameterDeclaration1ES5iterable.ts === -// A parameter declaration may specify either an identifier or a binding pattern. -// The identifiers specified in parameter declarations and binding patterns -// in a parameter list must be unique within that parameter list. - -// If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]: [number, number, string[][]]) { } ->a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 13)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 15)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 21)) - -function a2(o: { x: number, a: number }) { } ->a2 : Symbol(a2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 60)) ->o : Symbol(o, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 12)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 16)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 27)) - -function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; ->a3 : Symbol(a3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 44)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 13)) ->k : Symbol(k, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 15)) ->l : Symbol(l, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 68)) ->m : Symbol(m, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 23)) ->n : Symbol(n, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 25)) ->q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 98)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 34)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 36)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 39)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 46)) ->k : Symbol(k, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 57)) ->l : Symbol(l, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 68)) ->m : Symbol(m, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 73)) ->n : Symbol(n, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 85)) ->q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 98)) - -function a4({x, a}: { x: number, a: number }) { } ->a4 : Symbol(a4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 127)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 13)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 15)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 21)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 32)) - -a1([1, 2, [["world"]]]); ->a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) - -a1([1, 2, [["world"]], 3]); ->a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) - -// If the declaration includes an initializer expression (which is permitted only -// when the parameter list occurs in conjunction with a function body), -// the parameter type is the widened form (section 3.11) of the type of the initializer expression. - -function b1(z = [undefined, null]) { }; ->b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 11, 27)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 12)) ->undefined : Symbol(undefined) - -function b2(z = null, o = { x: 0, y: undefined }) { } ->b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 12)) ->o : Symbol(o, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 21)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 27)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 33)) ->undefined : Symbol(undefined) - -function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } ->b3 : Symbol(b3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 53)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 32)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 17)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 46)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 24)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 32)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 37)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 46)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 51)) - -interface F1 { ->F1 : Symbol(F1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 67)) - - b5(z, y, [, a, b], {p, m: { q, r}}); ->b5 : Symbol(F1.b5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 21, 14)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 7)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 9)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 15)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 18)) ->p : Symbol(p, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 24)) ->m : Symbol(m) ->q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 31)) ->r : Symbol(r, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 34)) -} - -function b6([a, z, y] = [undefined, null, undefined]) { } ->b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 23, 1)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 13)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 15)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 18)) ->undefined : Symbol(undefined) ->undefined : Symbol(undefined) - -function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } ->b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 57)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 14)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 17)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 23)) ->d : Symbol(d, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 25)) ->undefined : Symbol(undefined) ->undefined : Symbol(undefined) ->undefined : Symbol(undefined) ->undefined : Symbol(undefined) - -b1([1, 2, 3]); // z is widen to the type any[] ->b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 11, 27)) - -b2("string", { x: 200, y: "string" }); ->b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 29, 14)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 29, 22)) - -b2("string", { x: 200, y: true }); ->b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 30, 14)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 30, 22)) - -b6(["string", 1, 2]); // Shouldn't be an error ->b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 23, 1)) - -b7([["string"], 1, [[true, false]]]); // Shouldn't be an error ->b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 57)) - - -// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) -enum Foo { a } ->Foo : Symbol(Foo, Decl(destructuringParameterDeclaration1ES5iterable.ts, 32, 37)) ->a : Symbol(Foo.a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 10)) - -function c0({z: {x, y: {j}}}) { } ->c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) ->z : Symbol(z) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 17)) ->y : Symbol(y) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 24)) - -function c1({z} = { z: 10 }) { } ->c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 13)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 19)) - -function c2({z = 10}) { } ->c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 13)) - -function c3({b}: { b: number|string} = { b: "hello" }) { } ->c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 25)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 13)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 18)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 40)) - -function c5([a, b, [[c]]]) { } ->c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 13)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 15)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 21)) - -function c6([a, b, [[c=1]]]) { } ->c6 : Symbol(c6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 30)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 13)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 15)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 21)) - -c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } ->c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 4)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 9)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 15)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 20)) - -c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } ->c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 4)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 9)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 22)) ->j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 27)) - -c1(); // Implied type is {z:number}? ->c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) - -c1({ z: 1 }) // Implied type is {z:number}? ->c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 48, 4)) - -c2({}); // Implied type is {z?: number} ->c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) - -c2({z:1}); // Implied type is {z?: number} ->c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 51, 4)) - -c3({ b: 1 }); // Implied type is { b: number|string }. ->c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 25)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 53, 4)) - -c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] ->c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) - -c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] ->c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) - -// A parameter can be marked optional by following its name or binding pattern with a question mark (?) -// or by including an initializer. - -function d0(x?) { } ->d0 : Symbol(d0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 56, 38), Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 19)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 12)) - -function d0(x = 10) { } ->d0 : Symbol(d0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 56, 38), Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 19)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 12)) - -interface F2 { ->F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) - - d3([a, b, c]?); ->d3 : Symbol(F2.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 64, 14)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 8)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 10)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 13)) - - d4({x, y, z}?); ->d4 : Symbol(F2.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 19)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 8)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 10)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 13)) - - e0([a, b, c]); ->e0 : Symbol(F2.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 19)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 8)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 10)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 13)) -} - -class C2 implements F2 { ->C2 : Symbol(C2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 68, 1)) ->F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) - - constructor() { } - d3() { } ->d3 : Symbol(C2.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 71, 21)) - - d4() { } ->d4 : Symbol(C2.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 72, 12)) - - e0([a, b, c]) { } ->e0 : Symbol(C2.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 73, 12)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 8)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 10)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 13)) -} - -class C3 implements F2 { ->C3 : Symbol(C3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 75, 1)) ->F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) - - d3([a, b, c]) { } ->d3 : Symbol(C3.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 77, 24)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 8)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 10)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 13)) - - d4({x, y, z}) { } ->d4 : Symbol(C3.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 21)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 8)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 10)) ->z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 13)) - - e0([a, b, c]) { } ->e0 : Symbol(C3.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 21)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 8)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 10)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 13)) -} - - -function d5({x, y} = { x: 1, y: 2 }) { } ->d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 81, 1)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 13)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 15)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 22)) ->y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 28)) - -d5(); // Parameter is optional as its declaration included an initializer ->d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 81, 1)) - -// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, -// as such annotations would conflict with the already established meaning of colons in object literals. -// Type annotations must instead be written on the top- level parameter declaration - -function e1({x: number}) { } // x has type any NOT number ->e1 : Symbol(e1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 85, 5)) ->x : Symbol(x) ->number : Symbol(number, Decl(destructuringParameterDeclaration1ES5iterable.ts, 91, 13)) - -function e2({x}: { x: number }) { } // x is type number ->e2 : Symbol(e2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 91, 28)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 13)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 18)) - -function e3({x}: { x?: number }) { } // x is an optional with type number ->e3 : Symbol(e3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 35)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 13)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 18)) - -function e4({x: [number,string,any] }) { } // x has type [any, any, any] ->e4 : Symbol(e4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 36)) ->x : Symbol(x) ->number : Symbol(number, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 17)) ->string : Symbol(string, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 24)) ->any : Symbol(any, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 31)) - -function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] ->e5 : Symbol(e5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 42)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 29)) ->a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 17)) ->b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 19)) ->c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 22)) ->x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 29)) - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types deleted file mode 100644 index ffb2d81395b..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types +++ /dev/null @@ -1,431 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// - -=== destructuringParameterDeclaration1ES5iterable.ts === -// A parameter declaration may specify either an identifier or a binding pattern. -// The identifiers specified in parameter declarations and binding patterns -// in a parameter list must be unique within that parameter list. - -// If the declaration includes a type annotation, the parameter is of that type -function a1([a, b, [[c]]]: [number, number, string[][]]) { } ->a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->a : number ->b : number ->c : string - -function a2(o: { x: number, a: number }) { } ->a2 : (o: { x: number; a: number; }) => void ->o : { x: number; a: number; } ->x : number ->a : number - -function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; ->a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void ->j : number ->k : string ->l : any ->m : boolean ->n : number ->q : any ->a : string | number ->b : string | number ->c : string | number ->j : number ->k : string ->l : { m: boolean; n: number; } ->m : boolean ->n : number ->q : (string | number)[] - -function a4({x, a}: { x: number, a: number }) { } ->a4 : ({ x, a }: { x: number; a: number; }) => void ->x : number ->a : number ->x : number ->a : number - -a1([1, 2, [["world"]]]); ->a1([1, 2, [["world"]]]) : void ->a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]]] : [number, number, string[][]] ->1 : 1 ->2 : 2 ->[["world"]] : string[][] ->["world"] : string[] ->"world" : "world" - -a1([1, 2, [["world"]], 3]); ->a1([1, 2, [["world"]], 3]) : void ->a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void ->[1, 2, [["world"]], 3] : [number, number, string[][], number] ->1 : 1 ->2 : 2 ->[["world"]] : string[][] ->["world"] : string[] ->"world" : "world" ->3 : 3 - -// If the declaration includes an initializer expression (which is permitted only -// when the parameter list occurs in conjunction with a function body), -// the parameter type is the widened form (section 3.11) of the type of the initializer expression. - -function b1(z = [undefined, null]) { }; ->b1 : (z?: (null | undefined)[]) => void ->z : (null | undefined)[] ->[undefined, null] : (null | undefined)[] ->undefined : undefined - -function b2(z = null, o = { x: 0, y: undefined }) { } ->b2 : (z?: null, o?: { x: number; y: undefined; }) => void ->z : null ->o : { x: number; y: undefined; } ->{ x: 0, y: undefined } : { x: number; y: undefined; } ->x : number ->0 : 0 ->y : undefined ->undefined : undefined - -function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } ->b3 : ({ z: { x, y: { j } } }?: { z: { x: string; y: { j: number; }; }; }) => void ->z : any ->x : string ->y : any ->j : number ->{ z: { x: "hi", y: { j: 1 } } } : { z: { x: string; y: { j: number; }; }; } ->z : { x: string; y: { j: number; }; } ->{ x: "hi", y: { j: 1 } } : { x: string; y: { j: number; }; } ->x : string ->"hi" : "hi" ->y : { j: number; } ->{ j: 1 } : { j: number; } ->j : number ->1 : 1 - -interface F1 { - b5(z, y, [, a, b], {p, m: { q, r}}); ->b5 : (z: any, y: any, [, a, b]: [any, any, any], { p, m: { q, r } }: { m: { q: any; r: any; }; p: any; }) => any ->z : any ->y : any ->a : any ->b : any ->p : any ->m : any ->q : any ->r : any -} - -function b6([a, z, y] = [undefined, null, undefined]) { } ->b6 : ([a, z, y]?: [undefined, null, undefined]) => void ->a : undefined ->z : null ->y : undefined ->[undefined, null, undefined] : [undefined, null, undefined] ->undefined : undefined ->undefined : undefined - -function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } ->b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void ->a : undefined ->b : undefined ->c : undefined ->d : undefined ->[[undefined], undefined, [[undefined, undefined]]] : [[undefined], undefined, [[undefined, undefined]]] ->[undefined] : [undefined] ->undefined : undefined ->undefined : undefined ->[[undefined, undefined]] : [[undefined, undefined]] ->[undefined, undefined] : [undefined, undefined] ->undefined : undefined ->undefined : undefined - -b1([1, 2, 3]); // z is widen to the type any[] ->b1([1, 2, 3]) : void ->b1 : (z?: (null | undefined)[]) => void ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - -b2("string", { x: 200, y: "string" }); ->b2("string", { x: 200, y: "string" }) : void ->b2 : (z?: null, o?: { x: number; y: undefined; }) => void ->"string" : "string" ->{ x: 200, y: "string" } : { x: number; y: string; } ->x : number ->200 : 200 ->y : string ->"string" : "string" - -b2("string", { x: 200, y: true }); ->b2("string", { x: 200, y: true }) : void ->b2 : (z?: null, o?: { x: number; y: undefined; }) => void ->"string" : "string" ->{ x: 200, y: true } : { x: number; y: boolean; } ->x : number ->200 : 200 ->y : boolean ->true : true - -b6(["string", 1, 2]); // Shouldn't be an error ->b6(["string", 1, 2]) : void ->b6 : ([a, z, y]?: [undefined, null, undefined]) => void ->["string", 1, 2] : [string, number, number] ->"string" : "string" ->1 : 1 ->2 : 2 - -b7([["string"], 1, [[true, false]]]); // Shouldn't be an error ->b7([["string"], 1, [[true, false]]]) : void ->b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void ->[["string"], 1, [[true, false]]] : [[string], number, [[boolean, boolean]]] ->["string"] : [string] ->"string" : "string" ->1 : 1 ->[[true, false]] : [[boolean, boolean]] ->[true, false] : [boolean, boolean] ->true : true ->false : false - - -// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) -enum Foo { a } ->Foo : Foo ->a : Foo.a - -function c0({z: {x, y: {j}}}) { } ->c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void ->z : any ->x : any ->y : any ->j : any - -function c1({z} = { z: 10 }) { } ->c1 : ({ z }?: { z: number; }) => void ->z : number ->{ z: 10 } : { z: number; } ->z : number ->10 : 10 - -function c2({z = 10}) { } ->c2 : ({ z }: { z?: number | undefined; }) => void ->z : number ->10 : 10 - -function c3({b}: { b: number|string} = { b: "hello" }) { } ->c3 : ({ b }?: { b: string | number; }) => void ->b : string | number ->b : string | number ->{ b: "hello" } : { b: string; } ->b : string ->"hello" : "hello" - -function c5([a, b, [[c]]]) { } ->c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->a : any ->b : any ->c : any - -function c6([a, b, [[c=1]]]) { } ->c6 : ([a, b, [[c]]]: [any, any, [[(number | undefined)?]]]) => void ->a : any ->b : any ->c : number ->1 : 1 - -c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } ->c0({z : { x: 1, y: { j: "world" } }}) : void ->c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void ->{z : { x: 1, y: { j: "world" } }} : { z: { x: number; y: { j: string; }; }; } ->z : { x: number; y: { j: string; }; } ->{ x: 1, y: { j: "world" } } : { x: number; y: { j: string; }; } ->x : number ->1 : 1 ->y : { j: string; } ->{ j: "world" } : { j: string; } ->j : string ->"world" : "world" - -c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } ->c0({z : { x: "string", y: { j: true } }}) : void ->c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void ->{z : { x: "string", y: { j: true } }} : { z: { x: string; y: { j: boolean; }; }; } ->z : { x: string; y: { j: boolean; }; } ->{ x: "string", y: { j: true } } : { x: string; y: { j: boolean; }; } ->x : string ->"string" : "string" ->y : { j: boolean; } ->{ j: true } : { j: boolean; } ->j : boolean ->true : true - -c1(); // Implied type is {z:number}? ->c1() : void ->c1 : ({ z }?: { z: number; }) => void - -c1({ z: 1 }) // Implied type is {z:number}? ->c1({ z: 1 }) : void ->c1 : ({ z }?: { z: number; }) => void ->{ z: 1 } : { z: number; } ->z : number ->1 : 1 - -c2({}); // Implied type is {z?: number} ->c2({}) : void ->c2 : ({ z }: { z?: number | undefined; }) => void ->{} : {} - -c2({z:1}); // Implied type is {z?: number} ->c2({z:1}) : void ->c2 : ({ z }: { z?: number | undefined; }) => void ->{z:1} : { z: number; } ->z : number ->1 : 1 - -c3({ b: 1 }); // Implied type is { b: number|string }. ->c3({ b: 1 }) : void ->c3 : ({ b }?: { b: string | number; }) => void ->{ b: 1 } : { b: number; } ->b : number ->1 : 1 - -c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] ->c5([1, 2, [["string"]]]) : void ->c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]]] : [number, number, [[string]]] ->1 : 1 ->2 : 2 ->[["string"]] : [[string]] ->["string"] : [string] ->"string" : "string" - -c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] ->c5([1, 2, [["string"]], false, true]) : void ->c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : 1 ->2 : 2 ->[["string"]] : [[string]] ->["string"] : [string] ->"string" : "string" ->false : false ->true : true - -// A parameter can be marked optional by following its name or binding pattern with a question mark (?) -// or by including an initializer. - -function d0(x?) { } ->d0 : (x?: any) => void ->x : any - -function d0(x = 10) { } ->d0 : (x?: any) => void ->x : number ->10 : 10 - -interface F2 { - d3([a, b, c]?); ->d3 : ([a, b, c]?: [any, any, any]) => any ->a : any ->b : any ->c : any - - d4({x, y, z}?); ->d4 : ({ x, y, z }?: { x: any; y: any; z: any; }) => any ->x : any ->y : any ->z : any - - e0([a, b, c]); ->e0 : ([a, b, c]: [any, any, any]) => any ->a : any ->b : any ->c : any -} - -class C2 implements F2 { ->C2 : C2 - - constructor() { } - d3() { } ->d3 : () => void - - d4() { } ->d4 : () => void - - e0([a, b, c]) { } ->e0 : ([a, b, c]: [any, any, any]) => void ->a : any ->b : any ->c : any -} - -class C3 implements F2 { ->C3 : C3 - - d3([a, b, c]) { } ->d3 : ([a, b, c]: [any, any, any]) => void ->a : any ->b : any ->c : any - - d4({x, y, z}) { } ->d4 : ({ x, y, z }: { x: any; y: any; z: any; }) => void ->x : any ->y : any ->z : any - - e0([a, b, c]) { } ->e0 : ([a, b, c]: [any, any, any]) => void ->a : any ->b : any ->c : any -} - - -function d5({x, y} = { x: 1, y: 2 }) { } ->d5 : ({ x, y }?: { x: number; y: number; }) => void ->x : number ->y : number ->{ x: 1, y: 2 } : { x: number; y: number; } ->x : number ->1 : 1 ->y : number ->2 : 2 - -d5(); // Parameter is optional as its declaration included an initializer ->d5() : void ->d5 : ({ x, y }?: { x: number; y: number; }) => void - -// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, -// as such annotations would conflict with the already established meaning of colons in object literals. -// Type annotations must instead be written on the top- level parameter declaration - -function e1({x: number}) { } // x has type any NOT number ->e1 : ({ x: number }: { x: any; }) => void ->x : any ->number : any - -function e2({x}: { x: number }) { } // x is type number ->e2 : ({ x }: { x: number; }) => void ->x : number ->x : number - -function e3({x}: { x?: number }) { } // x is an optional with type number ->e3 : ({ x }: { x?: number | undefined; }) => void ->x : number | undefined ->x : number | undefined - -function e4({x: [number,string,any] }) { } // x has type [any, any, any] ->e4 : ({ x: [number, string, any] }: { x: [any, any, any]; }) => void ->x : any ->number : any ->string : any ->any : any - -function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] ->e5 : ({ x: [a, b, c] }: { x: [number, number, number]; }) => void ->x : any ->a : number ->b : number ->c : number ->x : [number, number, number] - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff deleted file mode 100644 index ea762d440dd..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff +++ /dev/null @@ -1,37 +0,0 @@ ---- old.destructuringParameterDeclaration1ES5iterable.types -+++ new.destructuringParameterDeclaration1ES5iterable.types -@@= skipped -18, +18 lines =@@ - >a : number - - function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; -->a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (number | string)[]; }) => void -+>a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void - >j : number - >k : string - >l : any -@@= skipped -192, +192 lines =@@ - >10 : 10 - - function c3({b}: { b: number|string} = { b: "hello" }) { } -->c3 : ({ b }?: { b: number | string; }) => void -+>c3 : ({ b }?: { b: string | number; }) => void - >b : string | number - >b : string | number - >{ b: "hello" } : { b: string; } -@@= skipped -71, +71 lines =@@ - - c3({ b: 1 }); // Implied type is { b: number|string }. - >c3({ b: 1 }) : void -->c3 : ({ b }?: { b: number | string; }) => void -+>c3 : ({ b }?: { b: string | number; }) => void - >{ b: 1 } : { b: number; } - >b : number - >1 : 1 -@@= skipped -128, +128 lines =@@ - >x : number - - function e3({x}: { x?: number }) { } // x is an optional with type number -->e3 : ({ x }: { x?: number; }) => void -+>e3 : ({ x }: { x?: number | undefined; }) => void - >x : number | undefined - >x : number | undefined diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt deleted file mode 100644 index 3162c188f3d..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt +++ /dev/null @@ -1,85 +0,0 @@ -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. -destructuringParameterDeclaration3ES5iterable.ts(16,22): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration3ES5iterable.ts(17,15): error TS7031: Binding element 'a' implicitly has an 'any' type. -destructuringParameterDeclaration3ES5iterable.ts(17,18): error TS7031: Binding element 'b' implicitly has an 'any' type. -destructuringParameterDeclaration3ES5iterable.ts(17,23): error TS7031: Binding element 'c' implicitly has an 'any' type. -destructuringParameterDeclaration3ES5iterable.ts(17,31): error TS7031: Binding element 'x' implicitly has an 'any' type. -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]]'. -destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]], ...any[]]'. - Source has 2 element(s) but target requires 3. - - -==== 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. - - // RestParameter: - // ... Identifier TypeAnnotation(opt) - - type arrayString = Array - type someArray = Array | number[]; - type stringOrNumArray = Array; - - function a1(...x: (number|string)[]) { } - function a2(...a) { } - ~~~~ -!!! error TS7019: Rest parameter 'a' implicitly has an 'any[]' type. - function a3(...a: Array) { } - function a4(...a: arrayString) { } - function a5(...a: stringOrNumArray) { } - function a9([a, b, [[c]]]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - function a10([a, b, [[c]], ...x]) { } - ~ -!!! error TS7031: Binding element 'a' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'b' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'c' implicitly has an 'any' type. - ~ -!!! error TS7031: Binding element 'x' implicitly has an 'any' type. - function a11([a, b, c, ...x]: number[]) { } - - - var array = [1, 2, 3]; - var array2 = [true, false, "hello"]; - a2([...array]); - a1(...array); - - a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. -!!! error TS2345: Source has 5 element(s) but target allows only 3. - - a10([1, 2, [["string"]], false, true]); // Parameter type is any[] - a10([1, 2, 3, false, true]); // Parameter type is any[] - ~ -!!! error TS2322: Type 'number' is not assignable to type '[[any]]'. - a10([1, 2]); // Parameter type is any[] - ~~~~~~ -!!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]], ...any[]]'. -!!! error TS2345: Source has 2 element(s) but target requires 3. - a11([1, 2]); // Parameter type is number[] - - // Rest parameter with generic - function foo(...a: T[]) { } - foo("hello", 1, 2); - foo("hello", "world"); - - enum E { a, b } - const enum E1 { a, b } - function foo1(...a: T[]) { } - foo1(1, 2, 3, E.a); - foo1(1, 2, 3, E1.a, E.b); - - - \ No newline at end of file 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 deleted file mode 100644 index a730dfb6915..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt -+++ 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. - 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 =@@ - 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 (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/destructuringParameterDeclaration3ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js deleted file mode 100644 index 43baf42b6ba..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js +++ /dev/null @@ -1,82 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// - -//// [destructuringParameterDeclaration3ES5iterable.ts] -// If the parameter is a rest parameter, the parameter type is any[] -// A type annotation for a rest parameter must denote an array type. - -// RestParameter: -// ... Identifier TypeAnnotation(opt) - -type arrayString = Array -type someArray = Array | number[]; -type stringOrNumArray = Array; - -function a1(...x: (number|string)[]) { } -function a2(...a) { } -function a3(...a: Array) { } -function a4(...a: arrayString) { } -function a5(...a: stringOrNumArray) { } -function a9([a, b, [[c]]]) { } -function a10([a, b, [[c]], ...x]) { } -function a11([a, b, c, ...x]: number[]) { } - - -var array = [1, 2, 3]; -var array2 = [true, false, "hello"]; -a2([...array]); -a1(...array); - -a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] - -a10([1, 2, [["string"]], false, true]); // Parameter type is any[] -a10([1, 2, 3, false, true]); // Parameter type is any[] -a10([1, 2]); // Parameter type is any[] -a11([1, 2]); // Parameter type is number[] - -// Rest parameter with generic -function foo(...a: T[]) { } -foo("hello", 1, 2); -foo("hello", "world"); - -enum E { a, b } -const enum E1 { a, b } -function foo1(...a: T[]) { } -foo1(1, 2, 3, E.a); -foo1(1, 2, 3, E1.a, E.b); - - - - -//// [destructuringParameterDeclaration3ES5iterable.js] -"use strict"; -// If the parameter is a rest parameter, the parameter type is any[] -// A type annotation for a rest parameter must denote an array type. -function a1(...x) { } -function a2(...a) { } -function a3(...a) { } -function a4(...a) { } -function a5(...a) { } -function a9([a, b, [[c]]]) { } -function a10([a, b, [[c]], ...x]) { } -function a11([a, b, c, ...x]) { } -var array = [1, 2, 3]; -var array2 = [true, false, "hello"]; -a2([...array]); -a1(...array); -a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] -a10([1, 2, [["string"]], false, true]); // Parameter type is any[] -a10([1, 2, 3, false, true]); // Parameter type is any[] -a10([1, 2]); // Parameter type is any[] -a11([1, 2]); // Parameter type is number[] -// Rest parameter with generic -function foo(...a) { } -foo("hello", 1, 2); -foo("hello", "world"); -var E; -(function (E) { - E[E["a"] = 0] = "a"; - E[E["b"] = 1] = "b"; -})(E || (E = {})); -function foo1(...a) { } -foo1(1, 2, 3, E.a); -foo1(1, 2, 3, 0 /* E1.a */, E.b); diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols deleted file mode 100644 index 4cec32eff4f..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,146 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// - -=== destructuringParameterDeclaration3ES5iterable.ts === -// If the parameter is a rest parameter, the parameter type is any[] -// A type annotation for a rest parameter must denote an array type. - -// RestParameter: -// ... Identifier TypeAnnotation(opt) - -type arrayString = Array ->arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5iterable.ts, 0, 0)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) - -type someArray = Array | number[]; ->someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 6, 32)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) - -type stringOrNumArray = Array; ->stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 7, 42)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) - -function a1(...x: (number|string)[]) { } ->a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 8, 45)) ->x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 12)) - -function a2(...a) { } ->a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 40)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 11, 12)) - -function a3(...a: Array) { } ->a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5iterable.ts, 11, 21)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 12, 12)) ->Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) ->String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) - -function a4(...a: arrayString) { } ->a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5iterable.ts, 12, 36)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 13, 12)) ->arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5iterable.ts, 0, 0)) - -function a5(...a: stringOrNumArray) { } ->a5 : Symbol(a5, Decl(destructuringParameterDeclaration3ES5iterable.ts, 13, 34)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 12)) ->stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 7, 42)) - -function a9([a, b, [[c]]]) { } ->a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 39)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 13)) ->b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 15)) ->c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 21)) - -function a10([a, b, [[c]], ...x]) { } ->a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 14)) ->b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 16)) ->c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 22)) ->x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 26)) - -function a11([a, b, c, ...x]: number[]) { } ->a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 37)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 14)) ->b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 16)) ->c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 19)) ->x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 22)) - - -var array = [1, 2, 3]; ->array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) - -var array2 = [true, false, "hello"]; ->array2 : Symbol(array2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 21, 3)) - -a2([...array]); ->a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 40)) ->array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) - -a1(...array); ->a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 8, 45)) ->array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) - -a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] ->a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 39)) - -a10([1, 2, [["string"]], false, true]); // Parameter type is any[] ->a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) - -a10([1, 2, 3, false, true]); // Parameter type is any[] ->a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) - -a10([1, 2]); // Parameter type is any[] ->a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) - -a11([1, 2]); // Parameter type is number[] ->a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 37)) - -// Rest parameter with generic -function foo(...a: T[]) { } ->foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) ->T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 13)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 16)) ->T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 13)) - -foo("hello", 1, 2); ->foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) - -foo("hello", "world"); ->foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) - -enum E { a, b } ->E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) ->a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) ->b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) - -const enum E1 { a, b } ->E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 15)) ->a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) ->b : Symbol(E1.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 18)) - -function foo1(...a: T[]) { } ->foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) ->T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 14)) ->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 32)) ->T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 14)) - -foo1(1, 2, 3, E.a); ->foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) ->E.a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) ->E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) ->a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) - -foo1(1, 2, 3, E1.a, E.b); ->foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) ->E1.a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) ->E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 15)) ->a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) ->E.b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) ->E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) ->b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) - - - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types deleted file mode 100644 index c1123928f62..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types +++ /dev/null @@ -1,191 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// - -=== destructuringParameterDeclaration3ES5iterable.ts === -// If the parameter is a rest parameter, the parameter type is any[] -// A type annotation for a rest parameter must denote an array type. - -// RestParameter: -// ... Identifier TypeAnnotation(opt) - -type arrayString = Array ->arrayString : arrayString - -type someArray = Array | number[]; ->someArray : someArray - -type stringOrNumArray = Array; ->stringOrNumArray : stringOrNumArray - -function a1(...x: (number|string)[]) { } ->a1 : (...x: (string | number)[]) => void ->x : (string | number)[] - -function a2(...a) { } ->a2 : (...a: any[]) => void ->a : any[] - -function a3(...a: Array) { } ->a3 : (...a: String[]) => void ->a : String[] - -function a4(...a: arrayString) { } ->a4 : (...a: arrayString) => void ->a : arrayString - -function a5(...a: stringOrNumArray) { } ->a5 : (...a: stringOrNumArray) => void ->a : stringOrNumArray - -function a9([a, b, [[c]]]) { } ->a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->a : any ->b : any ->c : any - -function a10([a, b, [[c]], ...x]) { } ->a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->a : any ->b : any ->c : any ->x : any[] - -function a11([a, b, c, ...x]: number[]) { } ->a11 : ([a, b, c, ...x]: number[]) => void ->a : number ->b : number ->c : number ->x : number[] - - -var array = [1, 2, 3]; ->array : number[] ->[1, 2, 3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - -var array2 = [true, false, "hello"]; ->array2 : (string | boolean)[] ->[true, false, "hello"] : (string | boolean)[] ->true : true ->false : false ->"hello" : "hello" - -a2([...array]); ->a2([...array]) : void ->a2 : (...a: any[]) => void ->[...array] : number[] ->...array : number ->array : number[] - -a1(...array); ->a1(...array) : void ->a1 : (...x: (string | number)[]) => void ->...array : number ->array : number[] - -a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] ->a9([1, 2, [["string"]], false, true]) : void ->a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void ->[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : 1 ->2 : 2 ->[["string"]] : [[string]] ->["string"] : [string] ->"string" : "string" ->false : false ->true : true - -a10([1, 2, [["string"]], false, true]); // Parameter type is any[] ->a10([1, 2, [["string"]], false, true]) : void ->a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] ->1 : 1 ->2 : 2 ->[["string"]] : [[string]] ->["string"] : [string] ->"string" : "string" ->false : false ->true : true - -a10([1, 2, 3, false, true]); // Parameter type is any[] ->a10([1, 2, 3, false, true]) : void ->a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2, 3, false, true] : [number, number, number, boolean, boolean] ->1 : 1 ->2 : 2 ->3 : 3 ->false : false ->true : true - -a10([1, 2]); // Parameter type is any[] ->a10([1, 2]) : void ->a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void ->[1, 2] : [number, number] ->1 : 1 ->2 : 2 - -a11([1, 2]); // Parameter type is number[] ->a11([1, 2]) : void ->a11 : ([a, b, c, ...x]: number[]) => void ->[1, 2] : number[] ->1 : 1 ->2 : 2 - -// Rest parameter with generic -function foo(...a: T[]) { } ->foo : (...a: T[]) => void ->a : T[] - -foo("hello", 1, 2); ->foo("hello", 1, 2) : void ->foo : (...a: T[]) => void ->"hello" : "hello" ->1 : 1 ->2 : 2 - -foo("hello", "world"); ->foo("hello", "world") : void ->foo : (...a: T[]) => void ->"hello" : "hello" ->"world" : "world" - -enum E { a, b } ->E : E ->a : E.a ->b : E.b - -const enum E1 { a, b } ->E1 : E1 ->a : E1.a ->b : E1.b - -function foo1(...a: T[]) { } ->foo1 : (...a: T[]) => void ->a : T[] - -foo1(1, 2, 3, E.a); ->foo1(1, 2, 3, E.a) : void ->foo1 : (...a: T[]) => void ->1 : 1 ->2 : 2 ->3 : 3 ->E.a : E.a ->E : typeof E ->a : E.a - -foo1(1, 2, 3, E1.a, E.b); ->foo1(1, 2, 3, E1.a, E.b) : void ->foo1 : (...a: T[]) => void ->1 : 1 ->2 : 2 ->3 : 3 ->E1.a : E1.a ->E1 : typeof E1 ->a : E1.a ->E.b : E.b ->E : typeof E ->b : E.b - - - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff deleted file mode 100644 index 61ca2c5ec0a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff +++ /dev/null @@ -1,28 +0,0 @@ ---- old.destructuringParameterDeclaration3ES5iterable(target=es2015).types -+++ new.destructuringParameterDeclaration3ES5iterable(target=es2015).types -@@= skipped -16, +16 lines =@@ - >stringOrNumArray : stringOrNumArray - - function a1(...x: (number|string)[]) { } -->a1 : (...x: (number | string)[]) => void -+>a1 : (...x: (string | number)[]) => void - >x : (string | number)[] - - function a2(...a) { } -@@= skipped -8, +8 lines =@@ - >a : any[] - - function a3(...a: Array) { } -->a3 : (...a: Array) => void -+>a3 : (...a: String[]) => void - >a : String[] - - function a4(...a: arrayString) { } -@@= skipped -55, +55 lines =@@ - - a1(...array); - >a1(...array) : void -->a1 : (...x: (number | string)[]) => void -+>a1 : (...x: (string | number)[]) => void - >...array : number - >array : number[] 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 deleted file mode 100644 index 76868b483c6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt -+++ new.destructuringParameterDeclaration7ES5iterable(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 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/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js deleted file mode 100644 index 3f0c319f5b0..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js +++ /dev/null @@ -1,23 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// - -//// [destructuringParameterDeclaration7ES5iterable.ts] -interface ISomething { - foo: string, - bar: string -} - -function foo({}, {foo, bar}: ISomething) {} - -function baz([], {foo, bar}: ISomething) {} - -function one([], {}) {} - -function two([], [a, b, c]: number[]) {} - - -//// [destructuringParameterDeclaration7ES5iterable.js] -"use strict"; -function foo({}, { foo, bar }) { } -function baz([], { foo, bar }) { } -function one([], {}) { } -function two([], [a, b, c]) { } diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols deleted file mode 100644 index 6662a963079..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,34 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// - -=== destructuringParameterDeclaration7ES5iterable.ts === -interface ISomething { ->ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) - - foo: string, ->foo : Symbol(ISomething.foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 22)) - - bar: string ->bar : Symbol(ISomething.bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 1, 16)) -} - -function foo({}, {foo, bar}: ISomething) {} ->foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 3, 1)) ->foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 18)) ->bar : Symbol(bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 22)) ->ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) - -function baz([], {foo, bar}: ISomething) {} ->baz : Symbol(baz, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 43)) ->foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 18)) ->bar : Symbol(bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 22)) ->ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) - -function one([], {}) {} ->one : Symbol(one, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 43)) - -function two([], [a, b, c]: number[]) {} ->two : Symbol(two, Decl(destructuringParameterDeclaration7ES5iterable.ts, 9, 23)) ->a : Symbol(a, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 18)) ->b : Symbol(b, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 20)) ->c : Symbol(c, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 23)) - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types deleted file mode 100644 index 917fdc4d2b6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types +++ /dev/null @@ -1,30 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// - -=== destructuringParameterDeclaration7ES5iterable.ts === -interface ISomething { - foo: string, ->foo : string - - bar: string ->bar : string -} - -function foo({}, {foo, bar}: ISomething) {} ->foo : ({}: {}, { foo, bar }: ISomething) => void ->foo : string ->bar : string - -function baz([], {foo, bar}: ISomething) {} ->baz : ([]: Iterable, { foo, bar }: ISomething) => void ->foo : string ->bar : string - -function one([], {}) {} ->one : ([]: Iterable, {}: {}) => void - -function two([], [a, b, c]: number[]) {} ->two : ([]: Iterable, [a, b, c]: number[]) => void ->a : number ->b : number ->c : number - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt deleted file mode 100644 index 499a38d7335..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt +++ /dev/null @@ -1,50 +0,0 @@ -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'. - - -==== 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. - 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] } }; - ~~~~~~~~~ -!!! error TS2322: Type 'undefined' is not assignable to type 'number'. - ~~~~ -!!! error TS2322: Type 'null' is not assignable to type 'number'. - - \ No newline at end of file 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 deleted file mode 100644 index d26f12c7093..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt -+++ 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. - 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. - ==== 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/destructuringVariableDeclaration1ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js deleted file mode 100644 index dd54c33fc91..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js +++ /dev/null @@ -1,80 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// - -//// [destructuringVariableDeclaration1ES5iterable.ts] -// 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] } }; - - - -//// [destructuringVariableDeclaration1ES5iterable.js] -"use strict"; -// 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: 10, a2: "world" }; -var [a3, [[a4]], a5] = [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: [1, 2] } }; -var { h: { h1 = [undefined, null] } } = { h: { h1: [1, 2] } }; diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols deleted file mode 100644 index 8ee0b316cd0..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,122 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// - -=== destructuringVariableDeclaration1ES5iterable.ts === -// 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" } ->a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 5)) ->a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 8)) ->a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 15)) ->a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 27)) ->a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 44)) ->a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 52)) - -var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; ->a3 : Symbol(a3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 5)) ->a4 : Symbol(a4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 11)) ->a5 : Symbol(a5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 16)) - -// 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" } }; ->b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 44)) ->b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 11)) ->b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 21)) ->b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 44)) ->b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 50)) - -var temp = { t1: true, t2: "false" }; ->temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) ->t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 12)) ->t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 22)) - -var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; ->b2 : Symbol(b2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 5)) ->b3 : Symbol(b3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 12)) ->b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 23)) ->temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) ->t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 49)) ->t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 60)) - -var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : Symbol(b5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 5)) ->b6 : Symbol(b6, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 12)) ->b7 : Symbol(b7, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 23)) ->temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) ->undefined : Symbol(undefined) ->undefined : Symbol(undefined) ->undefined : Symbol(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]; ->c1 : Symbol(c1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 15, 5)) - -var [...c2] = [1,2,3, "string"]; ->c2 : Symbol(c2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 16, 5)) - -// 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"] ->d1 : Symbol(d1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 22, 5)) ->d2 : Symbol(d2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 22, 8)) - -// 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] ->temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 27, 3)) - -var [d3, d4] = [1, "string", ...temp1]; ->d3 : Symbol(d3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 28, 5)) ->d4 : Symbol(d4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 28, 8)) ->temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 27, 3)) - -// Combining both forms of destructuring, -var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; ->e : Symbol(e, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 49)) ->e1 : Symbol(e1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 9)) ->e2 : Symbol(e2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 12)) ->e3 : Symbol(e3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 16)) ->b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 23)) ->b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 33)) ->e : Symbol(e, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 49)) ->b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 61)) ->b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 68)) - -var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; ->f : Symbol(f, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 41)) ->f1 : Symbol(f1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 9)) ->f2 : Symbol(f2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 12)) ->f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 53)) ->f4 : Symbol(f4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 18)) ->f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 26)) ->f : Symbol(f, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 41)) ->f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 53)) ->f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 60)) - -// 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] } }; ->g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 36)) ->g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 9)) ->undefined : Symbol(undefined) ->g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 36)) ->g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 41)) ->g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 59)) ->g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 64)) - -var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; ->h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 36)) ->h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 9)) ->undefined : Symbol(undefined) ->h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 36)) ->h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 41)) ->h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 62)) ->h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 67)) - - diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types deleted file mode 100644 index ca71624b138..00000000000 --- a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types +++ /dev/null @@ -1,199 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// - -=== destructuringVariableDeclaration1ES5iterable.ts === -// 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" } ->a1 : number ->a2 : string ->a1 : number ->a2 : string ->{ a1: 10, a2: "world" } : { a1: number; a2: string; } ->a1 : number ->10 : 10 ->a2 : string ->"world" : "world" - -var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; ->a3 : number ->a4 : string ->a5 : boolean ->[1, [["hello"]], true] : [number, [[string]], true] ->1 : 1 ->[["hello"]] : [[string]] ->["hello"] : [string] ->"hello" : "hello" ->true : 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" } }; ->b1 : any ->b11 : string ->{ b11: "string" } : { b11: string; } ->b11 : string ->"string" : "string" ->{ b1: { b11: "world" } } : { b1?: { b11: string; }; } ->b1 : { b11: string; } ->{ b11: "world" } : { b11: string; } ->b11 : string ->"world" : "world" - -var temp = { t1: true, t2: "false" }; ->temp : { t1: boolean; t2: string; } ->{ t1: true, t2: "false" } : { t1: boolean; t2: string; } ->t1 : boolean ->true : true ->t2 : string ->"false" : "false" - -var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; ->b2 : number ->3 : 3 ->b3 : boolean ->true : true ->b4 : { t1: boolean; t2: string; } ->temp : { t1: boolean; t2: string; } ->[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] ->3 : 3 ->false : false ->{ t1: false, t2: "hello" } : { t1: false; t2: string; } ->t1 : false ->false : false ->t2 : string ->"hello" : "hello" - -var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; ->b5 : number ->3 : 3 ->b6 : boolean ->true : true ->b7 : { t1: boolean; t2: string; } ->temp : { t1: boolean; t2: string; } ->[undefined, undefined, undefined] : [undefined, undefined, undefined] ->undefined : undefined ->undefined : 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]; ->c1 : number[] ->[1,2,3] : number[] ->1 : 1 ->2 : 2 ->3 : 3 - -var [...c2] = [1,2,3, "string"]; ->c2 : (string | number)[] ->[1,2,3, "string"] : (string | number)[] ->1 : 1 ->2 : 2 ->3 : 3 ->"string" : "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"] ->d1 : number ->d2 : string ->[1,"string"] : [number, string] ->1 : 1 ->"string" : "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] ->temp1 : boolean[] ->[true, false, true] : boolean[] ->true : true ->false : false ->true : true - -var [d3, d4] = [1, "string", ...temp1]; ->d3 : number ->d4 : string ->[1, "string", ...temp1] : [number, string, ...boolean[]] ->1 : 1 ->"string" : "string" ->...temp1 : boolean ->temp1 : boolean[] - -// Combining both forms of destructuring, -var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; ->e : any ->e1 : number ->e2 : number ->e3 : { b1: number; b4: number; } ->{ b1: 1000, b4: 200 } : { b1: number; b4: number; } ->b1 : number ->1000 : 1000 ->b4 : number ->200 : 200 ->{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } ->e : [number, number, { b1: number; b4: number; }] ->[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] ->1 : 1 ->2 : 2 ->{ b1: 4, b4: 0 } : { b1: number; b4: number; } ->b1 : number ->4 : 4 ->b4 : number ->0 : 0 - -var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; ->f : any ->f1 : number ->f2 : number ->f3 : any ->f4 : number ->f5 : number ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } ->f : [number, number, { f3: number; f5: number; }] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] ->1 : 1 ->2 : 2 ->{ f3: 4, f5: 0 } : { f3: number; f5: number; } ->f3 : number ->4 : 4 ->f5 : number ->0 : 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] } }; ->g : any ->g1 : any[] ->[undefined, null] : (null | undefined)[] ->undefined : undefined ->g : { g1: any[]; } ->g1 : any[] ->{ g: { g1: [1, 2] } } : { g: { g1: number[]; }; } ->g : { g1: number[]; } ->{ g1: [1, 2] } : { g1: number[]; } ->g1 : number[] ->[1, 2] : number[] ->1 : 1 ->2 : 2 - -var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; ->h : any ->h1 : number[] ->[undefined, null] : (null | undefined)[] ->undefined : undefined ->h : { h1: number[]; } ->h1 : number[] ->{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } ->h : { h1: number[]; } ->{ h1: [1, 2] } : { h1: number[]; } ->h1 : number[] ->[1, 2] : number[] ->1 : 1 ->2 : 2 - - 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 deleted file mode 100644 index 4ec32fb2103..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt -+++ new.emptyAssignmentPatterns01_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 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js deleted file mode 100644 index 10613e7a7dd..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js +++ /dev/null @@ -1,17 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// - -//// [emptyAssignmentPatterns01_ES5iterable.ts] -var a: any; - -({} = a); -([] = a); - -//// [emptyAssignmentPatterns01_ES5iterable.js] -"use strict"; -var a; -({} = a); -([] = a); - - -//// [emptyAssignmentPatterns01_ES5iterable.d.ts] -declare var a: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols deleted file mode 100644 index 5d488a00564..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,12 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// - -=== emptyAssignmentPatterns01_ES5iterable.ts === -var a: any; ->a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) - -({} = a); ->a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) - -([] = a); ->a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) - diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types deleted file mode 100644 index e8994133651..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types +++ /dev/null @@ -1,18 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// - -=== 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/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 deleted file mode 100644 index 07485e2089d..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt -+++ new.emptyAssignmentPatterns02_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 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js deleted file mode 100644 index c182ccd2964..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// - -//// [emptyAssignmentPatterns02_ES5iterable.ts] -var a: any; -let x, y, z, a1, a2, a3; - -({} = { x, y, z } = a); -([] = [ a1, a2, a3] = a); - -//// [emptyAssignmentPatterns02_ES5iterable.js] -"use strict"; -var a; -let x, y, z, a1, a2, a3; -({} = { x, y, z } = a); -([] = [a1, a2, a3] = a); - - -//// [emptyAssignmentPatterns02_ES5iterable.d.ts] -declare var a: any; -declare let x: any, y: any, z: any, a1: any, a2: any, a3: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols deleted file mode 100644 index d73c429d809..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,26 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// - -=== emptyAssignmentPatterns02_ES5iterable.ts === -var a: any; ->a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) - -let x, y, z, a1, a2, a3; ->x : Symbol(x, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 3)) ->y : Symbol(y, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 6)) ->z : Symbol(z, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 9)) ->a1 : Symbol(a1, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 12)) ->a2 : Symbol(a2, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 16)) ->a3 : Symbol(a3, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 20)) - -({} = { x, y, z } = a); ->x : Symbol(x, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 7)) ->y : Symbol(y, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 10)) ->z : Symbol(z, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 13)) ->a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) - -([] = [ a1, a2, a3] = a); ->a1 : Symbol(a1, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 12)) ->a2 : Symbol(a2, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 16)) ->a3 : Symbol(a3, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 20)) ->a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) - diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types deleted file mode 100644 index 5fa735a25ab..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// - -=== 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/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 deleted file mode 100644 index 8722f619aa8..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt -+++ new.emptyAssignmentPatterns03_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 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js deleted file mode 100644 index f6df328e83b..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js +++ /dev/null @@ -1,17 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// - -//// [emptyAssignmentPatterns03_ES5iterable.ts] -var a: any; - -({} = {} = a); -([] = [] = a); - -//// [emptyAssignmentPatterns03_ES5iterable.js] -"use strict"; -var a; -({} = {} = a); -([] = [] = a); - - -//// [emptyAssignmentPatterns03_ES5iterable.d.ts] -declare var a: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols deleted file mode 100644 index 83d02d139fc..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,12 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// - -=== emptyAssignmentPatterns03_ES5iterable.ts === -var a: any; ->a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) - -({} = {} = a); ->a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) - -([] = [] = a); ->a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) - diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types deleted file mode 100644 index 5412c533246..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types +++ /dev/null @@ -1,22 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// - -=== 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/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 deleted file mode 100644 index 7fdc9d6eec7..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt -+++ new.emptyAssignmentPatterns04_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 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/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js deleted file mode 100644 index 35b6abb4652..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js +++ /dev/null @@ -1,20 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// - -//// [emptyAssignmentPatterns04_ES5iterable.ts] -var a: any; -let x, y, z, a1, a2, a3; - -({ x, y, z } = {} = a); -([ a1, a2, a3] = [] = a); - -//// [emptyAssignmentPatterns04_ES5iterable.js] -"use strict"; -var a; -let x, y, z, a1, a2, a3; -({ x, y, z } = {} = a); -([a1, a2, a3] = [] = a); - - -//// [emptyAssignmentPatterns04_ES5iterable.d.ts] -declare var a: any; -declare let x: any, y: any, z: any, a1: any, a2: any, a3: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols deleted file mode 100644 index 696162e321a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,26 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// - -=== emptyAssignmentPatterns04_ES5iterable.ts === -var a: any; ->a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) - -let x, y, z, a1, a2, a3; ->x : Symbol(x, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 3)) ->y : Symbol(y, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 6)) ->z : Symbol(z, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 9)) ->a1 : Symbol(a1, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 12)) ->a2 : Symbol(a2, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 16)) ->a3 : Symbol(a3, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 20)) - -({ x, y, z } = {} = a); ->x : Symbol(x, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 2)) ->y : Symbol(y, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 5)) ->z : Symbol(z, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 8)) ->a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) - -([ a1, a2, a3] = [] = a); ->a1 : Symbol(a1, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 12)) ->a2 : Symbol(a2, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 16)) ->a3 : Symbol(a3, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 20)) ->a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) - diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types deleted file mode 100644 index 8673a737d38..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types +++ /dev/null @@ -1,36 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// - -=== 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/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 deleted file mode 100644 index ee0d242f175..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,57 +0,0 @@ ---- old.emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt -+++ new.emptyVariableDeclarationBindingPatterns01_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 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/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js deleted file mode 100644 index 64cdc1b4f95..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js +++ /dev/null @@ -1,89 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// - -//// [emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] -(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) { - } -})(); - -//// [emptyVariableDeclarationBindingPatterns01_ES5iterable.js] -"use strict"; -(function () { - var a; - 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 = []; - for (var {} of ns) { - } - for (let {} of ns) { - } - for (const {} of ns) { - } - for (var [] of ns) { - } - for (let [] of ns) { - } - for (const [] of ns) { - } -})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols deleted file mode 100644 index 99ed4d5911f..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,93 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// - -=== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts === -(function () { - var a: any; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - var {} = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - let {} = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - const {} = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - var [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - let [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - const [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - var {} = a, [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - let {} = a, [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - const {} = a, [] = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - var { p1: {}, p2: [] } = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - let { p1: {}, p2: [] } = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - const { p1: {}, p2: [] } = a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - for (var {} = {}, {} = {}; false; void 0) { - } - - function f({} = a, [] = a, { p: {} = a} = a) { ->f : Symbol(f, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 20, 5)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - - return ({} = a, [] = a, { p: {} = a } = a) => a; ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) ->a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) - } -})(); - -(function () { - const ns: number[][] = []; ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - - for (var {} of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } - - for (let {} of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } - - for (const {} of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } - - for (var [] of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } - - for (let [] of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } - - for (const [] of ns) { ->ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) - } -})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types deleted file mode 100644 index a80899f2567..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types +++ /dev/null @@ -1,116 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// - -=== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts === -(function () { ->(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; }})() : void ->(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; }}) : () => void ->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; }} : () => void - - 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 ->p2 : any ->a : any - - let { p1: {}, p2: [] } = a; ->p1 : any ->p2 : any ->a : any - - const { p1: {}, p2: [] } = a; ->p1 : any ->p2 : any ->a : any - - for (var {} = {}, {} = {}; false; void 0) { ->{} : {} ->{} : {} ->false : false ->void 0 : undefined ->0 : 0 - } - - function f({} = a, [] = a, { p: {} = a} = a) { ->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 - } -})(); - -(function () { ->(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) { }})() : void ->(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) { }}) : () => void ->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) { }} : () => void - - const ns: number[][] = []; ->ns : number[][] ->[] : never[] - - for (var {} of ns) { ->ns : number[][] - } - - for (let {} of ns) { ->ns : number[][] - } - - for (const {} of ns) { ->ns : number[][] - } - - for (var [] of ns) { ->ns : number[][] - } - - for (let [] of ns) { ->ns : number[][] - } - - for (const [] of ns) { ->ns : number[][] - } -})(); 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 deleted file mode 100644 index 2ab84a97c09..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt +++ /dev/null @@ -1,30 +0,0 @@ -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. -emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(6,9): error TS1182: A destructuring declaration must have an initializer. -emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(7,9): error TS1182: A destructuring declaration must have an initializer. -emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(8,11): error TS1182: A destructuring declaration must have an initializer. - - -==== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts (6 errors) ==== - (function () { - var {}; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - let {}; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - const {}; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - - var []; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - let []; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - const []; - ~~ -!!! error TS1182: A destructuring declaration must have an initializer. - })(); \ No newline at end of file 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 deleted file mode 100644 index 66386da6330..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt -+++ 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. - 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 =@@ - 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 {}; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js deleted file mode 100644 index 25681850f93..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js +++ /dev/null @@ -1,26 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// - -//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] -(function () { - var {}; - let {}; - const {}; - - var []; - let []; - const []; -})(); - -//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.js] -"use strict"; -(function () { - var {}; - let {}; - const {}; - var []; - let []; - const []; -})(); - - -//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.d.ts] diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols deleted file mode 100644 index 0cc47dcfaa7..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols +++ /dev/null @@ -1,13 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// - -=== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts === - -(function () { - var {}; - let {}; - const {}; - - var []; - let []; - const []; -})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types deleted file mode 100644 index 88cd703f8a9..00000000000 --- a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types +++ /dev/null @@ -1,16 +0,0 @@ -//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// - -=== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts === -(function () { ->(function () { var {}; let {}; const {}; var []; let []; const [];})() : void ->(function () { var {}; let {}; const {}; var []; let []; const [];}) : () => void ->function () { var {}; let {}; const {}; var []; let []; const [];} : () => void - - var {}; - let {}; - const {}; - - var []; - let []; - const []; -})(); 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 deleted file mode 100644 index 24be52271c6..00000000000 --- a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- old.forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt -+++ new.forAwaitPerIterationBindingDownlevel(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 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/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js deleted file mode 100644 index 352f36ae842..00000000000 --- a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js +++ /dev/null @@ -1,52 +0,0 @@ -//// [tests/cases/conformance/statements/for-await-ofStatements/forAwaitPerIterationBindingDownlevel.ts] //// - -//// [forAwaitPerIterationBindingDownlevel.ts] -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}`); - } - })(); - } -})(); - -//// [forAwaitPerIterationBindingDownlevel.js] -"use strict"; -const sleep = (tm) => 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}`); - } - })(); - } -})(); diff --git a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js.diff deleted file mode 100644 index 4afb780f684..00000000000 --- a/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js.diff +++ /dev/null @@ -1,91 +0,0 @@ ---- old.forAwaitPerIterationBindingDownlevel(target=es2015).js -+++ new.forAwaitPerIterationBindingDownlevel(target=es2015).js -@@= skipped -27, +27 lines =@@ - - //// [forAwaitPerIterationBindingDownlevel.js] - "use strict"; --var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { -- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } -- return new (P || (P = Promise))(function (resolve, reject) { -- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } -- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } -- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } -- step((generator = generator.apply(thisArg, _arguments || [])).next()); -- }); --}; --var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } --var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { -- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); -- var g = generator.apply(thisArg, _arguments || []), i, q = []; -- return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; -- function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } -- function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } -- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } -- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } -- function fulfill(value) { resume("next", value); } -- function reject(value) { resume("throw", value); } -- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } --}; --var __asyncValues = (this && this.__asyncValues) || function (o) { -- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); -- var m = o[Symbol.asyncIterator], i; -- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); -- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } -- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } --}; - const sleep = (tm) => new Promise(resolve => setTimeout(resolve, tm)); --function gen() { -- return __asyncGenerator(this, arguments, function* gen_1() { -- yield yield __await(1); -- yield __await(sleep(1000)); -- yield yield __await(2); -- }); -+async function* gen() { -+ yield 1; -+ await sleep(1000); -+ yield 2; - } - const log = console.log; --(() => __awaiter(void 0, void 0, void 0, function* () { -- var _a, e_1, _b, _c; -- try { -- for (var _d = true, _e = __asyncValues(gen()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) { -- _c = _f.value; -- _d = false; -- const outer = _c; -- log(`I'm loop ${outer}`); -- (() => __awaiter(void 0, void 0, void 0, function* () { -- const inner = outer; -- yield 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}`); -- } -- }))(); -- } -- } -- catch (e_1_1) { e_1 = { error: e_1_1 }; } -- finally { -- try { -- if (!_d && !_a && (_b = _e.return)) yield _b.call(_e); -- } -- finally { if (e_1) throw e_1.error; } -- } --}))(); -+(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/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff deleted file mode 100644 index f4957742eda..00000000000 --- a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.restParameterInDownlevelGenerator(target=es2015).errors.txt -+++ new.restParameterInDownlevelGenerator(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 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/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js deleted file mode 100644 index a315f9edd24..00000000000 --- a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js +++ /dev/null @@ -1,15 +0,0 @@ -//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// - -//// [restParameterInDownlevelGenerator.ts] -// https://github.com/Microsoft/TypeScript/issues/30653 -function * mergeStringLists(...strings: string[]) { - for (var str of strings); -} - -//// [restParameterInDownlevelGenerator.js] -"use strict"; -// https://github.com/Microsoft/TypeScript/issues/30653 -function* mergeStringLists(...strings) { - for (var str of strings) - ; -} diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols deleted file mode 100644 index acc027e7ec4..00000000000 --- a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols +++ /dev/null @@ -1,12 +0,0 @@ -//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// - -=== restParameterInDownlevelGenerator.ts === -// https://github.com/Microsoft/TypeScript/issues/30653 -function * mergeStringLists(...strings: string[]) { ->mergeStringLists : Symbol(mergeStringLists, Decl(restParameterInDownlevelGenerator.ts, 0, 0)) ->strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28)) - - for (var str of strings); ->str : Symbol(str, Decl(restParameterInDownlevelGenerator.ts, 2, 12)) ->strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28)) -} diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types deleted file mode 100644 index aeaee13ca2a..00000000000 --- a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types +++ /dev/null @@ -1,12 +0,0 @@ -//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// - -=== restParameterInDownlevelGenerator.ts === -// https://github.com/Microsoft/TypeScript/issues/30653 -function * mergeStringLists(...strings: string[]) { ->mergeStringLists : (...strings: string[]) => Generator ->strings : string[] - - for (var str of strings); ->str : string ->strings : string[] -} From c8f59d0211a6345ec05aab378f05a3091b0de1e3 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 4 Mar 2026 12:16:09 -0800 Subject: [PATCH 3/4] Clean up getIteratedTypeOrElementType --- internal/checker/checker.go | 23 +++++------------------ internal/core/compileroptions.go | 3 ++- 2 files changed, 7 insertions(+), 19 deletions(-) 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/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"` From 8d0015209788d598d5a85db80257390a45c43204 Mon Sep 17 00:00:00 2001 From: Jake Bailey <5341706+jakebailey@users.noreply.github.com> Date: Wed, 4 Mar 2026 12:20:09 -0800 Subject: [PATCH 4/4] Unskip tests and just let the errors flow --- internal/testutil/harnessutil/harnessutil.go | 3 - ...wnlevelGenerator(target=es2015).errors.txt | 11 + ...elGenerator(target=es2015).errors.txt.diff | 14 + ...ingsInDownlevelGenerator(target=es2015).js | 18 + ...nDownlevelGenerator(target=es2015).symbols | 16 + ...sInDownlevelGenerator(target=es2015).types | 24 + ...wnLevelGenerator(target=es2015).errors.txt | 8 + ...elGenerator(target=es2015).errors.txt.diff | 14 + ...nVarInDownLevelGenerator(target=es2015).js | 13 + ...InDownLevelGenerator(target=es2015).js.map | 3 + ...evelGenerator(target=es2015).sourcemap.txt | 67 +++ ...nDownLevelGenerator(target=es2015).symbols | 10 + ...rInDownLevelGenerator(target=es2015).types | 11 + .../ES5For-of33(target=es2015).errors.txt | 8 + ...ES5For-of33(target=es2015).errors.txt.diff | 14 + .../conformance/ES5For-of33(target=es2015).js | 13 + .../ES5For-of33(target=es2015).js.map | 3 + .../ES5For-of33(target=es2015).sourcemap.txt | 93 ++++ .../ES5For-of33(target=es2015).symbols | 12 + .../ES5For-of33(target=es2015).types | 17 + .../ES5For-of34(target=es2015).errors.txt | 14 + ...ES5For-of34(target=es2015).errors.txt.diff | 13 + .../conformance/ES5For-of34(target=es2015).js | 19 + .../ES5For-of34(target=es2015).js.map | 3 + .../ES5For-of34(target=es2015).sourcemap.txt | 152 ++++++ .../ES5For-of34(target=es2015).symbols | 20 + .../ES5For-of34(target=es2015).types | 28 ++ .../ES5For-of35(target=es2015).errors.txt | 15 + ...ES5For-of35(target=es2015).errors.txt.diff | 14 + .../conformance/ES5For-of35(target=es2015).js | 15 + .../ES5For-of35(target=es2015).js.map | 3 + .../ES5For-of35(target=es2015).sourcemap.txt | 121 +++++ .../ES5For-of35(target=es2015).symbols | 13 + .../ES5For-of35(target=es2015).types | 20 + .../ES5For-of36(target=es2015).errors.txt | 12 + ...ES5For-of36(target=es2015).errors.txt.diff | 13 + .../conformance/ES5For-of36(target=es2015).js | 15 + .../ES5For-of36(target=es2015).js.map | 3 + .../ES5For-of36(target=es2015).sourcemap.txt | 109 +++++ .../ES5For-of36(target=es2015).symbols | 13 + .../ES5For-of36(target=es2015).types | 18 + .../ES5For-of37(target=es2015).errors.txt | 20 + ...ES5For-of37(target=es2015).errors.txt.diff | 14 + .../conformance/ES5For-of37(target=es2015).js | 36 ++ .../ES5For-of37(target=es2015).symbols | 37 ++ .../ES5For-of37(target=es2015).types | 54 +++ ...preadES5iterable(target=es2015).errors.txt | 28 ++ ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...LiteralSpreadES5iterable(target=es2015).js | 49 ++ ...alSpreadES5iterable(target=es2015).symbols | 69 +++ ...eralSpreadES5iterable(target=es2015).types | 135 ++++++ ...owFunction11_es5(target=es2015).errors.txt | 12 + ...ction11_es5(target=es2015).errors.txt.diff | 14 + ...asyncArrowFunction11_es5(target=es2015).js | 29 ++ ...ArrowFunction11_es5(target=es2015).js.diff | 17 + ...ArrowFunction11_es5(target=es2015).symbols | 24 + ...ncArrowFunction11_es5(target=es2015).types | 29 ++ ...atternAndAssignment1ES5iterable.errors.txt | 67 +++ ...nAndAssignment1ES5iterable.errors.txt.diff | 15 + ...BindingPatternAndAssignment1ES5iterable.js | 103 +++++ ...ngPatternAndAssignment1ES5iterable.symbols | 107 +++++ ...dingPatternAndAssignment1ES5iterable.types | 169 +++++++ ...rnAndAssignment4(target=es2015).errors.txt | 14 + ...Assignment4(target=es2015).errors.txt.diff | 23 + ...ingPatternAndAssignment4(target=es2015).js | 14 + ...tternAndAssignment4(target=es2015).symbols | 13 + ...PatternAndAssignment4(target=es2015).types | 13 + ...rnAndAssignment4(target=es2015).types.diff | 9 + ...arameterDeclaration1ES5iterable.errors.txt | 286 ++++++++++++ ...terDeclaration1ES5iterable.errors.txt.diff | 17 + ...cturingParameterDeclaration1ES5iterable.js | 173 +++++++ ...ngParameterDeclaration1ES5iterable.symbols | 329 +++++++++++++ ...ringParameterDeclaration1ES5iterable.types | 431 ++++++++++++++++++ ...arameterDeclaration1ES5iterable.types.diff | 37 ++ ...tion3ES5iterable(target=es2015).errors.txt | 87 ++++ ...ES5iterable(target=es2015).errors.txt.diff | 17 + ...rDeclaration3ES5iterable(target=es2015).js | 82 ++++ ...aration3ES5iterable(target=es2015).symbols | 146 ++++++ ...claration3ES5iterable(target=es2015).types | 191 ++++++++ ...tion3ES5iterable(target=es2015).types.diff | 28 ++ ...tion7ES5iterable(target=es2015).errors.txt | 18 + ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...rDeclaration7ES5iterable(target=es2015).js | 23 + ...aration7ES5iterable(target=es2015).symbols | 34 ++ ...claration7ES5iterable(target=es2015).types | 30 ++ ...tion1ES5iterable(target=es2015).errors.txt | 52 +++ ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...eDeclaration1ES5iterable(target=es2015).js | 80 ++++ ...aration1ES5iterable(target=es2015).symbols | 122 +++++ ...claration1ES5iterable(target=es2015).types | 199 ++++++++ ...ns01_ES5iterable(target=es2015).errors.txt | 9 + ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...ntPatterns01_ES5iterable(target=es2015).js | 17 + ...terns01_ES5iterable(target=es2015).symbols | 12 + ...atterns01_ES5iterable(target=es2015).types | 18 + ...ns02_ES5iterable(target=es2015).errors.txt | 10 + ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...ntPatterns02_ES5iterable(target=es2015).js | 20 + ...terns02_ES5iterable(target=es2015).symbols | 26 ++ ...atterns02_ES5iterable(target=es2015).types | 36 ++ ...ns03_ES5iterable(target=es2015).errors.txt | 9 + ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...ntPatterns03_ES5iterable(target=es2015).js | 17 + ...terns03_ES5iterable(target=es2015).symbols | 12 + ...atterns03_ES5iterable(target=es2015).types | 22 + ...ns04_ES5iterable(target=es2015).errors.txt | 10 + ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...ntPatterns04_ES5iterable(target=es2015).js | 20 + ...terns04_ES5iterable(target=es2015).symbols | 26 ++ ...atterns04_ES5iterable(target=es2015).types | 36 ++ ...ns01_ES5iterable(target=es2015).errors.txt | 53 +++ ...ES5iterable(target=es2015).errors.txt.diff | 14 + ...ngPatterns01_ES5iterable(target=es2015).js | 89 ++++ ...terns01_ES5iterable(target=es2015).symbols | 93 ++++ ...atterns01_ES5iterable(target=es2015).types | 116 +++++ ...ns02_ES5iterable(target=es2015).errors.txt | 32 ++ ...ES5iterable(target=es2015).errors.txt.diff | 17 + ...ngPatterns02_ES5iterable(target=es2015).js | 26 ++ ...terns02_ES5iterable(target=es2015).symbols | 13 + ...atterns02_ES5iterable(target=es2015).types | 16 + ...BindingDownlevel(target=es2015).errors.txt | 29 ++ ...ngDownlevel(target=es2015).errors.txt.diff | 14 + ...terationBindingDownlevel(target=es2015).js | 96 ++++ ...wnlevelGenerator(target=es2015).errors.txt | 9 + ...elGenerator(target=es2015).errors.txt.diff | 14 + ...eterInDownlevelGenerator(target=es2015).js | 15 + ...nDownlevelGenerator(target=es2015).symbols | 12 + ...rInDownlevelGenerator(target=es2015).types | 12 + 128 files changed, 5566 insertions(+), 3 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types create mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js create mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols create mode 100644 testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types diff --git a/internal/testutil/harnessutil/harnessutil.go b/internal/testutil/harnessutil/harnessutil.go index f76b2737b92..2cdb2a3b150 100644 --- a/internal/testutil/harnessutil/harnessutil.go +++ b/internal/testutil/harnessutil/harnessutil.go @@ -1224,9 +1224,6 @@ func SkipUnsupportedCompilerOptions(t *testing.T, options *core.CompilerOptions) if options.OutFile != "" { t.Skipf("unsupported outFile %s", options.OutFile) } - if !options.DownlevelIteration.IsUnknown() { - t.Skipf("unsupported downlevelIteration") - } switch options.Target { case core.ScriptTargetES5: t.Skipf("unsupported target %s", options.Target) 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 new file mode 100644 index 00000000000..feef6a586ff --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.blockScopedBindingsInDownlevelGenerator(target=es2015).errors.txt ++++ new.blockScopedBindingsInDownlevelGenerator(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 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. ++ ++ ++!!! 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/blockScopedBindingsInDownlevelGenerator(target=es2015).js b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js new file mode 100644 index 00000000000..c9bb7e11f04 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).js @@ -0,0 +1,18 @@ +//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// + +//// [blockScopedBindingsInDownlevelGenerator.ts] +function* a() { + for (const i of [1,2,3]) { + (() => i)() + yield i + } +} + +//// [blockScopedBindingsInDownlevelGenerator.js] +"use strict"; +function* a() { + for (const i of [1, 2, 3]) { + (() => i)(); + yield i; + } +} diff --git a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols new file mode 100644 index 00000000000..8b906350c4f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).symbols @@ -0,0 +1,16 @@ +//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// + +=== blockScopedBindingsInDownlevelGenerator.ts === +function* a() { +>a : Symbol(a, Decl(blockScopedBindingsInDownlevelGenerator.ts, 0, 0)) + + for (const i of [1,2,3]) { +>i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) + + (() => i)() +>i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) + + yield i +>i : Symbol(i, Decl(blockScopedBindingsInDownlevelGenerator.ts, 1, 12)) + } +} diff --git a/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types new file mode 100644 index 00000000000..4a4f5ee57e3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/blockScopedBindingsInDownlevelGenerator(target=es2015).types @@ -0,0 +1,24 @@ +//// [tests/cases/compiler/blockScopedBindingsInDownlevelGenerator.ts] //// + +=== blockScopedBindingsInDownlevelGenerator.ts === +function* a() { +>a : () => Generator + + for (const i of [1,2,3]) { +>i : number +>[1,2,3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + + (() => i)() +>(() => i)() : number +>(() => i) : () => number +>() => i : () => number +>i : number + + yield i +>yield i : any +>i : number + } +} 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 new file mode 100644 index 00000000000..11bf31c3e9a --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.sourceMapValidationVarInDownLevelGenerator(target=es2015).errors.txt ++++ new.sourceMapValidationVarInDownLevelGenerator(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 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. ++ ++ ++!!! 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).js b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js new file mode 100644 index 00000000000..372682b45a8 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js @@ -0,0 +1,13 @@ +//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// + +//// [sourceMapValidationVarInDownLevelGenerator.ts] +function * f() { + var x = 1, y; +} + +//// [sourceMapValidationVarInDownLevelGenerator.js] +"use strict"; +function* f() { + var x = 1, y; +} +//# sourceMappingURL=sourceMapValidationVarInDownLevelGenerator.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map new file mode 100644 index 00000000000..5db27574b3f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).js.map @@ -0,0 +1,3 @@ +//// [sourceMapValidationVarInDownLevelGenerator.js.map] +{"version":3,"file":"sourceMapValidationVarInDownLevelGenerator.js","sourceRoot":"","sources":["sourceMapValidationVarInDownLevelGenerator.ts"],"names":[],"mappings":";AAAA,QAAS,CAAC,CAAC,CAAC;IACR,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AACjB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24qIGYoKSB7DQogICAgdmFyIHggPSAxLCB5Ow0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9c291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic291cmNlTWFwVmFsaWRhdGlvblZhckluRG93bkxldmVsR2VuZXJhdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFTLENBQUMsQ0FBQyxDQUFDO0lBQ1IsSUFBSSxDQUFDLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUNqQixDQUFDIn0=,ZnVuY3Rpb24gKiBmKCkgewogICAgdmFyIHggPSAxLCB5Owp9 diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt new file mode 100644 index 00000000000..ea593b576bb --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).sourcemap.txt @@ -0,0 +1,67 @@ +=================================================================== +JsFile: sourceMapValidationVarInDownLevelGenerator.js +mapUrl: sourceMapValidationVarInDownLevelGenerator.js.map +sourceRoot: +sources: sourceMapValidationVarInDownLevelGenerator.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:sourceMapValidationVarInDownLevelGenerator.js +sourceFile:sourceMapValidationVarInDownLevelGenerator.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>function* f() { +1 > +2 >^^^^^^^^ +3 > ^ +4 > ^ +5 > ^ +6 > ^^^^^^^-> +1 > +2 >function +3 > * +4 > +5 > f +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 9) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 11) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 12) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 13) + SourceIndex(0) +--- +>>> var x = 1, y; +1->^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^ +1->() { + > +2 > var +3 > x +4 > = +5 > 1 +6 > , +7 > y +8 > ; +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 9) Source(2, 9) + SourceIndex(0) +3 >Emitted(3, 10) Source(2, 10) + SourceIndex(0) +4 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +5 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +6 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +7 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +8 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=sourceMapValidationVarInDownLevelGenerator.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols new file mode 100644 index 00000000000..6398cd2ed41 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).symbols @@ -0,0 +1,10 @@ +//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// + +=== sourceMapValidationVarInDownLevelGenerator.ts === +function * f() { +>f : Symbol(f, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 0, 0)) + + var x = 1, y; +>x : Symbol(x, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 1, 7)) +>y : Symbol(y, Decl(sourceMapValidationVarInDownLevelGenerator.ts, 1, 14)) +} diff --git a/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types new file mode 100644 index 00000000000..7f38ceeb19e --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sourceMapValidationVarInDownLevelGenerator(target=es2015).types @@ -0,0 +1,11 @@ +//// [tests/cases/compiler/sourceMapValidationVarInDownLevelGenerator.ts] //// + +=== sourceMapValidationVarInDownLevelGenerator.ts === +function * f() { +>f : () => Generator + + var x = 1, y; +>x : number +>1 : 1 +>y : any +} 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 new file mode 100644 index 00000000000..083f94e7b96 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.ES5For-of33(target=es2015).errors.txt ++++ new.ES5For-of33(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 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. ++ ++ ++!!! 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).js b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js new file mode 100644 index 00000000000..72e9e2fc3c8 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// + +//// [ES5For-of33.ts] +for (var v of ['a', 'b', 'c']) { + console.log(v); +} + +//// [ES5For-of33.js] +"use strict"; +for (var v of ['a', 'b', 'c']) { + console.log(v); +} +//# sourceMappingURL=ES5For-of33.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map new file mode 100644 index 00000000000..d4a1e2fbc4e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).js.map @@ -0,0 +1,3 @@ +//// [ES5For-of33.js.map] +{"version":3,"file":"ES5For-of33.js","sourceRoot":"","sources":["ES5For-of33.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACnB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICBjb25zb2xlLmxvZyh2KTsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjMzLmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzMy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsSUFBSSxDQUFDLEdBQUcsRUFBRSxHQUFHLEVBQUUsR0FBRyxDQUFDLEVBQUUsQ0FBQztJQUM1QixPQUFPLENBQUMsR0FBRyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ25CLENBQUMifQ==,Zm9yICh2YXIgdiBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIGNvbnNvbGUubG9nKHYpOwp9 diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt new file mode 100644 index 00000000000..7a0d0f21b14 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).sourcemap.txt @@ -0,0 +1,93 @@ +=================================================================== +JsFile: ES5For-of33.js +mapUrl: ES5For-of33.js.map +sourceRoot: +sources: ES5For-of33.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ES5For-of33.js +sourceFile:ES5For-of33.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>for (var v of ['a', 'b', 'c']) { +1 > +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^^^^ +6 > ^ +7 > ^^^ +8 > ^^ +9 > ^^^ +10> ^^ +11> ^^^ +12> ^ +13> ^^ +14> ^ +1 > +2 >for ( +3 > var +4 > v +5 > of +6 > [ +7 > 'a' +8 > , +9 > 'b' +10> , +11> 'c' +12> ] +13> ) +14> { +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +6 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 21) + SourceIndex(0) +9 >Emitted(2, 24) Source(1, 24) + SourceIndex(0) +10>Emitted(2, 26) Source(1, 26) + SourceIndex(0) +11>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +12>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +13>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +14>Emitted(2, 33) Source(1, 33) + SourceIndex(0) +--- +>>> console.log(v); +1 >^^^^ +2 > ^^^^^^^ +3 > ^ +4 > ^^^ +5 > ^ +6 > ^ +7 > ^ +8 > ^ +1 > + > +2 > console +3 > . +4 > log +5 > ( +6 > v +7 > ) +8 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 13) Source(2, 13) + SourceIndex(0) +4 >Emitted(3, 16) Source(2, 16) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 19) Source(2, 19) + SourceIndex(0) +8 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of33.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols new file mode 100644 index 00000000000..6ab34a601a0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).symbols @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// + +=== ES5For-of33.ts === +for (var v of ['a', 'b', 'c']) { +>v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) + + console.log(v); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>v : Symbol(v, Decl(ES5For-of33.ts, 0, 8)) +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types new file mode 100644 index 00000000000..57c9bfc5ac0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of33(target=es2015).types @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of33.ts] //// + +=== ES5For-of33.ts === +for (var v of ['a', 'b', 'c']) { +>v : string +>['a', 'b', 'c'] : string[] +>'a' : "a" +>'b' : "b" +>'c' : "c" + + console.log(v); +>console.log(v) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>v : string +} 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 new file mode 100644 index 00000000000..90f82ef8ab7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt @@ -0,0 +1,14 @@ +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 }; + } + for (foo().x of ['a', 'b', 'c']) { + ~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + var p = foo().x; + } \ No newline at end of file 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 new file mode 100644 index 00000000000..171bb8bbfb0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).errors.txt.diff @@ -0,0 +1,13 @@ +--- old.ES5For-of34(target=es2015).errors.txt ++++ 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-of34(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js new file mode 100644 index 00000000000..619ce3aea26 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js @@ -0,0 +1,19 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// + +//// [ES5For-of34.ts] +function foo() { + return { x: 0 }; +} +for (foo().x of ['a', 'b', 'c']) { + var p = foo().x; +} + +//// [ES5For-of34.js] +"use strict"; +function foo() { + return { x: 0 }; +} +for (foo().x of ['a', 'b', 'c']) { + var p = foo().x; +} +//# sourceMappingURL=ES5For-of34.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map new file mode 100644 index 00000000000..7b83e481ed5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).js.map @@ -0,0 +1,3 @@ +//// [ES5For-of34.js.map] +{"version":3,"file":"ES5For-of34.js","sourceRoot":"","sources":["ES5For-of34.ts"],"names":[],"mappings":";AAAA,SAAS,GAAG;IACR,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AACpB,CAAC;AACD,KAAK,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;IAC9B,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACpB,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZnVuY3Rpb24gZm9vKCkgew0KICAgIHJldHVybiB7IHg6IDAgfTsNCn0NCmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsNCiAgICB2YXIgcCA9IGZvbygpLng7DQp9DQovLyMgc291cmNlTWFwcGluZ1VSTD1FUzVGb3Itb2YzNC5qcy5tYXA=,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsU0FBUyxHQUFHO0lBQ1IsT0FBTyxFQUFFLENBQUMsRUFBRSxDQUFDLEVBQUUsQ0FBQztBQUNwQixDQUFDO0FBQ0QsS0FBSyxHQUFHLEVBQUUsQ0FBQyxDQUFDLElBQUksQ0FBQyxHQUFHLEVBQUUsR0FBRyxFQUFFLEdBQUcsQ0FBQyxFQUFFLENBQUM7SUFDOUIsSUFBSSxDQUFDLEdBQUcsR0FBRyxFQUFFLENBQUMsQ0FBQyxDQUFDO0FBQ3BCLENBQUMifQ==,ZnVuY3Rpb24gZm9vKCkgewogICAgcmV0dXJuIHsgeDogMCB9Owp9CmZvciAoZm9vKCkueCBvZiBbJ2EnLCAnYicsICdjJ10pIHsKICAgIHZhciBwID0gZm9vKCkueDsKfQ== diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt new file mode 100644 index 00000000000..9b513e0affa --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).sourcemap.txt @@ -0,0 +1,152 @@ +=================================================================== +JsFile: ES5For-of34.js +mapUrl: ES5For-of34.js.map +sourceRoot: +sources: ES5For-of34.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ES5For-of34.js +sourceFile:ES5For-of34.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>function foo() { +1 > +2 >^^^^^^^^^ +3 > ^^^ +4 > ^^^^^^^^^-> +1 > +2 >function +3 > foo +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +3 >Emitted(2, 13) Source(1, 13) + SourceIndex(0) +--- +>>> return { x: 0 }; +1->^^^^ +2 > ^^^^^^^ +3 > ^^ +4 > ^ +5 > ^^ +6 > ^ +7 > ^^ +8 > ^ +1->() { + > +2 > return +3 > { +4 > x +5 > : +6 > 0 +7 > } +8 > ; +1->Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 12) Source(2, 12) + SourceIndex(0) +3 >Emitted(3, 14) Source(2, 14) + SourceIndex(0) +4 >Emitted(3, 15) Source(2, 15) + SourceIndex(0) +5 >Emitted(3, 17) Source(2, 17) + SourceIndex(0) +6 >Emitted(3, 18) Source(2, 18) + SourceIndex(0) +7 >Emitted(3, 20) Source(2, 20) + SourceIndex(0) +8 >Emitted(3, 21) Source(2, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(4, 1) Source(3, 1) + SourceIndex(0) +2 >Emitted(4, 2) Source(3, 2) + SourceIndex(0) +--- +>>>for (foo().x of ['a', 'b', 'c']) { +1-> +2 >^^^^^ +3 > ^^^ +4 > ^^ +5 > ^ +6 > ^ +7 > ^^^^ +8 > ^ +9 > ^^^ +10> ^^ +11> ^^^ +12> ^^ +13> ^^^ +14> ^ +15> ^^ +16> ^ +1-> + > +2 >for ( +3 > foo +4 > () +5 > . +6 > x +7 > of +8 > [ +9 > 'a' +10> , +11> 'b' +12> , +13> 'c' +14> ] +15> ) +16> { +1->Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 6) Source(4, 6) + SourceIndex(0) +3 >Emitted(5, 9) Source(4, 9) + SourceIndex(0) +4 >Emitted(5, 11) Source(4, 11) + SourceIndex(0) +5 >Emitted(5, 12) Source(4, 12) + SourceIndex(0) +6 >Emitted(5, 13) Source(4, 13) + SourceIndex(0) +7 >Emitted(5, 17) Source(4, 17) + SourceIndex(0) +8 >Emitted(5, 18) Source(4, 18) + SourceIndex(0) +9 >Emitted(5, 21) Source(4, 21) + SourceIndex(0) +10>Emitted(5, 23) Source(4, 23) + SourceIndex(0) +11>Emitted(5, 26) Source(4, 26) + SourceIndex(0) +12>Emitted(5, 28) Source(4, 28) + SourceIndex(0) +13>Emitted(5, 31) Source(4, 31) + SourceIndex(0) +14>Emitted(5, 32) Source(4, 32) + SourceIndex(0) +15>Emitted(5, 34) Source(4, 34) + SourceIndex(0) +16>Emitted(5, 35) Source(4, 35) + SourceIndex(0) +--- +>>> var p = foo().x; +1 >^^^^ +2 > ^^^^ +3 > ^ +4 > ^^^ +5 > ^^^ +6 > ^^ +7 > ^ +8 > ^ +9 > ^ +1 > + > +2 > var +3 > p +4 > = +5 > foo +6 > () +7 > . +8 > x +9 > ; +1 >Emitted(6, 5) Source(5, 5) + SourceIndex(0) +2 >Emitted(6, 9) Source(5, 9) + SourceIndex(0) +3 >Emitted(6, 10) Source(5, 10) + SourceIndex(0) +4 >Emitted(6, 13) Source(5, 13) + SourceIndex(0) +5 >Emitted(6, 16) Source(5, 16) + SourceIndex(0) +6 >Emitted(6, 18) Source(5, 18) + SourceIndex(0) +7 >Emitted(6, 19) Source(5, 19) + SourceIndex(0) +8 >Emitted(6, 20) Source(5, 20) + SourceIndex(0) +9 >Emitted(6, 21) Source(5, 21) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(7, 1) Source(6, 1) + SourceIndex(0) +2 >Emitted(7, 2) Source(6, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of34.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols new file mode 100644 index 00000000000..6f167440f88 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).symbols @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// + +=== ES5For-of34.ts === +function foo() { +>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) + + return { x: 0 }; +>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) +} +for (foo().x of ['a', 'b', 'c']) { +>foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) + + var p = foo().x; +>p : Symbol(p, Decl(ES5For-of34.ts, 4, 7)) +>foo().x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) +>foo : Symbol(foo, Decl(ES5For-of34.ts, 0, 0)) +>x : Symbol(x, Decl(ES5For-of34.ts, 1, 12)) +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types new file mode 100644 index 00000000000..3756fa5565f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of34(target=es2015).types @@ -0,0 +1,28 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts] //// + +=== ES5For-of34.ts === +function foo() { +>foo : () => { x: number; } + + return { x: 0 }; +>{ x: 0 } : { x: number; } +>x : number +>0 : 0 +} +for (foo().x of ['a', 'b', 'c']) { +>foo().x : number +>foo() : { x: number; } +>foo : () => { x: number; } +>x : number +>['a', 'b', 'c'] : string[] +>'a' : "a" +>'b' : "b" +>'c' : "c" + + var p = foo().x; +>p : number +>foo().x : number +>foo() : { x: number; } +>foo : () => { x: number; } +>x : number +} 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 new file mode 100644 index 00000000000..0e82738d28e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt @@ -0,0 +1,15 @@ +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]) { + ~ +!!! error TS2339: Property 'x' does not exist on type 'Number'. + ~ +!!! error TS2339: Property 'y' does not exist on type 'Number'. + a; + b; + } \ No newline at end of file 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 new file mode 100644 index 00000000000..a83f8b7c96b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.ES5For-of35(target=es2015).errors.txt ++++ 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-of35(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js new file mode 100644 index 00000000000..efe54ffb61c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// + +//// [ES5For-of35.ts] +for (const {x: a = 0, y: b = 1} of [2, 3]) { + a; + b; +} + +//// [ES5For-of35.js] +"use strict"; +for (const { x: a = 0, y: b = 1 } of [2, 3]) { + a; + b; +} +//# sourceMappingURL=ES5For-of35.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map new file mode 100644 index 00000000000..97e36b718a8 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).js.map @@ -0,0 +1,3 @@ +//// [ES5For-of35.js.map] +{"version":3,"file":"ES5For-of35.js","sourceRoot":"","sources":["ES5For-of35.ts"],"names":[],"mappings":";AAAA,KAAK,MAAM,EAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,EAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IACxC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChjb25zdCB7IHg6IGEgPSAwLCB5OiBiID0gMSB9IG9mIFsyLCAzXSkgew0KICAgIGE7DQogICAgYjsNCn0NCi8vIyBzb3VyY2VNYXBwaW5nVVJMPUVTNUZvci1vZjM1LmpzLm1hcA==,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxNQUFNLEVBQUMsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsR0FBRyxDQUFDLEVBQUMsSUFBSSxDQUFDLENBQUMsRUFBRSxDQUFDLENBQUMsRUFBRSxDQUFDO0lBQ3hDLENBQUMsQ0FBQztJQUNGLENBQUMsQ0FBQztBQUNOLENBQUMifQ==,Zm9yIChjb25zdCB7eDogYSA9IDAsIHk6IGIgPSAxfSBvZiBbMiwgM10pIHsKICAgIGE7CiAgICBiOwp9 diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt new file mode 100644 index 00000000000..d82f2294f2b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).sourcemap.txt @@ -0,0 +1,121 @@ +=================================================================== +JsFile: ES5For-of35.js +mapUrl: ES5For-of35.js.map +sourceRoot: +sources: ES5For-of35.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ES5For-of35.js +sourceFile:ES5For-of35.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>for (const { x: a = 0, y: b = 1 } of [2, 3]) { +1 > +2 >^^^^^ +3 > ^^^^^^ +4 > ^^ +5 > ^ +6 > ^^ +7 > ^ +8 > ^^^ +9 > ^ +10> ^^ +11> ^ +12> ^^ +13> ^ +14> ^^^ +15> ^ +16> ^^ +17> ^^^^ +18> ^ +19> ^ +20> ^^ +21> ^ +22> ^ +23> ^^ +24> ^ +1 > +2 >for ( +3 > const +4 > { +5 > x +6 > : +7 > a +8 > = +9 > 0 +10> , +11> y +12> : +13> b +14> = +15> 1 +16> } +17> of +18> [ +19> 2 +20> , +21> 3 +22> ] +23> ) +24> { +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +4 >Emitted(2, 14) Source(1, 13) + SourceIndex(0) +5 >Emitted(2, 15) Source(1, 14) + SourceIndex(0) +6 >Emitted(2, 17) Source(1, 16) + SourceIndex(0) +7 >Emitted(2, 18) Source(1, 17) + SourceIndex(0) +8 >Emitted(2, 21) Source(1, 20) + SourceIndex(0) +9 >Emitted(2, 22) Source(1, 21) + SourceIndex(0) +10>Emitted(2, 24) Source(1, 23) + SourceIndex(0) +11>Emitted(2, 25) Source(1, 24) + SourceIndex(0) +12>Emitted(2, 27) Source(1, 26) + SourceIndex(0) +13>Emitted(2, 28) Source(1, 27) + SourceIndex(0) +14>Emitted(2, 31) Source(1, 30) + SourceIndex(0) +15>Emitted(2, 32) Source(1, 31) + SourceIndex(0) +16>Emitted(2, 34) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 38) Source(1, 36) + SourceIndex(0) +18>Emitted(2, 39) Source(1, 37) + SourceIndex(0) +19>Emitted(2, 40) Source(1, 38) + SourceIndex(0) +20>Emitted(2, 42) Source(1, 40) + SourceIndex(0) +21>Emitted(2, 43) Source(1, 41) + SourceIndex(0) +22>Emitted(2, 44) Source(1, 42) + SourceIndex(0) +23>Emitted(2, 46) Source(1, 44) + SourceIndex(0) +24>Emitted(2, 47) Source(1, 45) + SourceIndex(0) +--- +>>> a; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^-> +1 > + > +2 > a +3 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +--- +>>> b; +1->^^^^ +2 > ^ +3 > ^ +1-> + > +2 > b +3 > ; +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of35.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols new file mode 100644 index 00000000000..8dcd9d0ccdd --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).symbols @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// + +=== ES5For-of35.ts === +for (const {x: a = 0, y: b = 1} of [2, 3]) { +>a : Symbol(a, Decl(ES5For-of35.ts, 0, 12)) +>b : Symbol(b, Decl(ES5For-of35.ts, 0, 21)) + + a; +>a : Symbol(a, Decl(ES5For-of35.ts, 0, 12)) + + b; +>b : Symbol(b, Decl(ES5For-of35.ts, 0, 21)) +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types new file mode 100644 index 00000000000..7df7ab76b24 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of35(target=es2015).types @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts] //// + +=== ES5For-of35.ts === +for (const {x: a = 0, y: b = 1} of [2, 3]) { +>x : any +>a : any +>0 : 0 +>y : any +>b : any +>1 : 1 +>[2, 3] : number[] +>2 : 2 +>3 : 3 + + a; +>a : any + + b; +>b : any +} 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 new file mode 100644 index 00000000000..9fab0939bf7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt @@ -0,0 +1,12 @@ +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]) { + ~~~~~~~~~~~~~~ +!!! error TS2488: Type 'number' must have a '[Symbol.iterator]()' method that returns an iterator. + a; + b; + } \ No newline at end of file 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 new file mode 100644 index 00000000000..c557b4d1893 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).errors.txt.diff @@ -0,0 +1,13 @@ +--- old.ES5For-of36(target=es2015).errors.txt ++++ 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-of36(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js new file mode 100644 index 00000000000..dde2cc8ec54 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// + +//// [ES5For-of36.ts] +for (let [a = 0, b = 1] of [2, 3]) { + a; + b; +} + +//// [ES5For-of36.js] +"use strict"; +for (let [a = 0, b = 1] of [2, 3]) { + a; + b; +} +//# sourceMappingURL=ES5For-of36.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map new file mode 100644 index 00000000000..a5125e9ba69 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).js.map @@ -0,0 +1,3 @@ +//// [ES5For-of36.js.map] +{"version":3,"file":"ES5For-of36.js","sourceRoot":"","sources":["ES5For-of36.ts"],"names":[],"mappings":";AAAA,KAAK,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;IAChC,CAAC,CAAC;IACF,CAAC,CAAC;AACN,CAAC"} +//// https://sokra.github.io/source-map-visualization#base64,InVzZSBzdHJpY3QiOw0KZm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7DQogICAgYTsNCiAgICBiOw0KfQ0KLy8jIHNvdXJjZU1hcHBpbmdVUkw9RVM1Rm9yLW9mMzYuanMubWFw,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRVM1Rm9yLW9mMzYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJFUzVGb3Itb2YzNi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsS0FBSyxJQUFJLENBQUMsQ0FBQyxHQUFHLENBQUMsRUFBRSxDQUFDLEdBQUcsQ0FBQyxDQUFDLElBQUksQ0FBQyxDQUFDLEVBQUUsQ0FBQyxDQUFDLEVBQUUsQ0FBQztJQUNoQyxDQUFDLENBQUM7SUFDRixDQUFDLENBQUM7QUFDTixDQUFDIn0=,Zm9yIChsZXQgW2EgPSAwLCBiID0gMV0gb2YgWzIsIDNdKSB7CiAgICBhOwogICAgYjsKfQ== diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt new file mode 100644 index 00000000000..ee613c44d6d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).sourcemap.txt @@ -0,0 +1,109 @@ +=================================================================== +JsFile: ES5For-of36.js +mapUrl: ES5For-of36.js.map +sourceRoot: +sources: ES5For-of36.ts +=================================================================== +------------------------------------------------------------------- +emittedFile:ES5For-of36.js +sourceFile:ES5For-of36.ts +------------------------------------------------------------------- +>>>"use strict"; +>>>for (let [a = 0, b = 1] of [2, 3]) { +1 > +2 >^^^^^ +3 > ^^^^ +4 > ^ +5 > ^ +6 > ^^^ +7 > ^ +8 > ^^ +9 > ^ +10> ^^^ +11> ^ +12> ^ +13> ^^^^ +14> ^ +15> ^ +16> ^^ +17> ^ +18> ^ +19> ^^ +20> ^ +1 > +2 >for ( +3 > let +4 > [ +5 > a +6 > = +7 > 0 +8 > , +9 > b +10> = +11> 1 +12> ] +13> of +14> [ +15> 2 +16> , +17> 3 +18> ] +19> ) +20> { +1 >Emitted(2, 1) Source(1, 1) + SourceIndex(0) +2 >Emitted(2, 6) Source(1, 6) + SourceIndex(0) +3 >Emitted(2, 10) Source(1, 10) + SourceIndex(0) +4 >Emitted(2, 11) Source(1, 11) + SourceIndex(0) +5 >Emitted(2, 12) Source(1, 12) + SourceIndex(0) +6 >Emitted(2, 15) Source(1, 15) + SourceIndex(0) +7 >Emitted(2, 16) Source(1, 16) + SourceIndex(0) +8 >Emitted(2, 18) Source(1, 18) + SourceIndex(0) +9 >Emitted(2, 19) Source(1, 19) + SourceIndex(0) +10>Emitted(2, 22) Source(1, 22) + SourceIndex(0) +11>Emitted(2, 23) Source(1, 23) + SourceIndex(0) +12>Emitted(2, 24) Source(1, 24) + SourceIndex(0) +13>Emitted(2, 28) Source(1, 28) + SourceIndex(0) +14>Emitted(2, 29) Source(1, 29) + SourceIndex(0) +15>Emitted(2, 30) Source(1, 30) + SourceIndex(0) +16>Emitted(2, 32) Source(1, 32) + SourceIndex(0) +17>Emitted(2, 33) Source(1, 33) + SourceIndex(0) +18>Emitted(2, 34) Source(1, 34) + SourceIndex(0) +19>Emitted(2, 36) Source(1, 36) + SourceIndex(0) +20>Emitted(2, 37) Source(1, 37) + SourceIndex(0) +--- +>>> a; +1 >^^^^ +2 > ^ +3 > ^ +4 > ^-> +1 > + > +2 > a +3 > ; +1 >Emitted(3, 5) Source(2, 5) + SourceIndex(0) +2 >Emitted(3, 6) Source(2, 6) + SourceIndex(0) +3 >Emitted(3, 7) Source(2, 7) + SourceIndex(0) +--- +>>> b; +1->^^^^ +2 > ^ +3 > ^ +1-> + > +2 > b +3 > ; +1->Emitted(4, 5) Source(3, 5) + SourceIndex(0) +2 >Emitted(4, 6) Source(3, 6) + SourceIndex(0) +3 >Emitted(4, 7) Source(3, 7) + SourceIndex(0) +--- +>>>} +1 > +2 >^ +3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> +1 > + > +2 >} +1 >Emitted(5, 1) Source(4, 1) + SourceIndex(0) +2 >Emitted(5, 2) Source(4, 2) + SourceIndex(0) +--- +>>>//# sourceMappingURL=ES5For-of36.js.map \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols new file mode 100644 index 00000000000..5385cfbb0d7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).symbols @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// + +=== ES5For-of36.ts === +for (let [a = 0, b = 1] of [2, 3]) { +>a : Symbol(a, Decl(ES5For-of36.ts, 0, 10)) +>b : Symbol(b, Decl(ES5For-of36.ts, 0, 16)) + + a; +>a : Symbol(a, Decl(ES5For-of36.ts, 0, 10)) + + b; +>b : Symbol(b, Decl(ES5For-of36.ts, 0, 16)) +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types new file mode 100644 index 00000000000..f0530569894 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of36(target=es2015).types @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts] //// + +=== ES5For-of36.ts === +for (let [a = 0, b = 1] of [2, 3]) { +>a : any +>0 : 0 +>b : any +>1 : 1 +>[2, 3] : number[] +>2 : 2 +>3 : 3 + + a; +>a : any + + b; +>b : any +} 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 new file mode 100644 index 00000000000..be753d3ff33 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.ES5For-of37(target=es2015).errors.txt ++++ new.ES5For-of37(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 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. ++ ++ ++!!! 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/ES5For-of37(target=es2015).js b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js new file mode 100644 index 00000000000..44111f96ab7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).js @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// + +//// [ES5For-of37.ts] +// 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); + } +} + +//// [ES5For-of37.js] +"use strict"; +// 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); + } +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols new file mode 100644 index 00000000000..e23334fe836 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).symbols @@ -0,0 +1,37 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// + +=== ES5For-of37.ts === +// https://github.com/microsoft/TypeScript/issues/30083 + +for (const i of [0, 1, 2, 3, 4]) { +>i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) + + try { + // Ensure catch binding for the following loop is reset per iteration: + for (const j of [1, 2, 3]) { +>j : Symbol(j, Decl(ES5For-of37.ts, 5, 18)) + + if (i === 2) { +>i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) + + throw new Error('ERR'); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + } + } + console.log(i); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) + + } catch (err) { +>err : Symbol(err, Decl(ES5For-of37.ts, 11, 13)) + + console.log('E %s %s', i, err); +>console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) +>i : Symbol(i, Decl(ES5For-of37.ts, 2, 10)) +>err : Symbol(err, Decl(ES5For-of37.ts, 11, 13)) + } +} diff --git a/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types new file mode 100644 index 00000000000..26db819c1af --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/ES5For-of37(target=es2015).types @@ -0,0 +1,54 @@ +//// [tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts] //// + +=== ES5For-of37.ts === +// https://github.com/microsoft/TypeScript/issues/30083 + +for (const i of [0, 1, 2, 3, 4]) { +>i : number +>[0, 1, 2, 3, 4] : number[] +>0 : 0 +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 + + try { + // Ensure catch binding for the following loop is reset per iteration: + for (const j of [1, 2, 3]) { +>j : number +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + + if (i === 2) { +>i === 2 : boolean +>i : number +>2 : 2 + + throw new Error('ERR'); +>new Error('ERR') : Error +>Error : ErrorConstructor +>'ERR' : "ERR" + } + } + console.log(i); +>console.log(i) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>i : number + + } catch (err) { +>err : unknown + + console.log('E %s %s', i, err); +>console.log('E %s %s', i, err) : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>'E %s %s' : "E %s %s" +>i : number +>err : unknown + } +} 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 new file mode 100644 index 00000000000..6bf09a5e1bc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.arrayLiteralSpreadES5iterable(target=es2015).errors.txt ++++ new.arrayLiteralSpreadES5iterable(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 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. ++ ++ ++!!! 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/arrayLiteralSpreadES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js new file mode 100644 index 00000000000..22381a7440a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).js @@ -0,0 +1,49 @@ +//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// + +//// [arrayLiteralSpreadES5iterable.ts] +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]]]]]]; +} + + +//// [arrayLiteralSpreadES5iterable.js] +"use strict"; +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; +} +function f2() { + var a = [...[...[...[...[...[]]]]]]; + var b = [...[...[...[...[...[5]]]]]]; +} diff --git a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..949b2e07217 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).symbols @@ -0,0 +1,69 @@ +//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// + +=== arrayLiteralSpreadES5iterable.ts === +function f0() { +>f0 : Symbol(f0, Decl(arrayLiteralSpreadES5iterable.ts, 0, 0)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a1 = [...a]; +>a1 : Symbol(a1, Decl(arrayLiteralSpreadES5iterable.ts, 2, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a2 = [1, ...a]; +>a2 : Symbol(a2, Decl(arrayLiteralSpreadES5iterable.ts, 3, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a3 = [1, 2, ...a]; +>a3 : Symbol(a3, Decl(arrayLiteralSpreadES5iterable.ts, 4, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a4 = [...a, 1]; +>a4 : Symbol(a4, Decl(arrayLiteralSpreadES5iterable.ts, 5, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a5 = [...a, 1, 2]; +>a5 : Symbol(a5, Decl(arrayLiteralSpreadES5iterable.ts, 6, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a6 = [1, 2, ...a, 1, 2]; +>a6 : Symbol(a6, Decl(arrayLiteralSpreadES5iterable.ts, 7, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a7 = [1, ...a, 2, ...a]; +>a7 : Symbol(a7, Decl(arrayLiteralSpreadES5iterable.ts, 8, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) + + var a8 = [...a, ...a, ...a]; +>a8 : Symbol(a8, Decl(arrayLiteralSpreadES5iterable.ts, 9, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 1, 7)) +} + +function f1() { +>f1 : Symbol(f1, Decl(arrayLiteralSpreadES5iterable.ts, 10, 1)) + + var a = [1, 2, 3]; +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 13, 7)) + + var b = ["hello", ...a, true]; +>b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 14, 7), Decl(arrayLiteralSpreadES5iterable.ts, 15, 7)) +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 13, 7)) + + var b: (string | number | boolean)[]; +>b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 14, 7), Decl(arrayLiteralSpreadES5iterable.ts, 15, 7)) +} + +function f2() { +>f2 : Symbol(f2, Decl(arrayLiteralSpreadES5iterable.ts, 16, 1)) + + var a = [...[...[...[...[...[]]]]]]; +>a : Symbol(a, Decl(arrayLiteralSpreadES5iterable.ts, 19, 7)) + + var b = [...[...[...[...[...[5]]]]]]; +>b : Symbol(b, Decl(arrayLiteralSpreadES5iterable.ts, 20, 7)) +} + diff --git a/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types new file mode 100644 index 00000000000..4967fa77ea9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/arrayLiteralSpreadES5iterable(target=es2015).types @@ -0,0 +1,135 @@ +//// [tests/cases/conformance/es6/spread/arrayLiteralSpreadES5iterable.ts] //// + +=== arrayLiteralSpreadES5iterable.ts === +function f0() { +>f0 : () => void + + var a = [1, 2, 3]; +>a : number[] +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + + var a1 = [...a]; +>a1 : number[] +>[...a] : number[] +>...a : number +>a : number[] + + var a2 = [1, ...a]; +>a2 : number[] +>[1, ...a] : number[] +>1 : 1 +>...a : number +>a : number[] + + var a3 = [1, 2, ...a]; +>a3 : number[] +>[1, 2, ...a] : number[] +>1 : 1 +>2 : 2 +>...a : number +>a : number[] + + var a4 = [...a, 1]; +>a4 : number[] +>[...a, 1] : number[] +>...a : number +>a : number[] +>1 : 1 + + var a5 = [...a, 1, 2]; +>a5 : number[] +>[...a, 1, 2] : number[] +>...a : number +>a : number[] +>1 : 1 +>2 : 2 + + var a6 = [1, 2, ...a, 1, 2]; +>a6 : number[] +>[1, 2, ...a, 1, 2] : number[] +>1 : 1 +>2 : 2 +>...a : number +>a : number[] +>1 : 1 +>2 : 2 + + var a7 = [1, ...a, 2, ...a]; +>a7 : number[] +>[1, ...a, 2, ...a] : number[] +>1 : 1 +>...a : number +>a : number[] +>2 : 2 +>...a : number +>a : number[] + + var a8 = [...a, ...a, ...a]; +>a8 : number[] +>[...a, ...a, ...a] : number[] +>...a : number +>a : number[] +>...a : number +>a : number[] +>...a : number +>a : number[] +} + +function f1() { +>f1 : () => void + + var a = [1, 2, 3]; +>a : number[] +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + + var b = ["hello", ...a, true]; +>b : (string | number | boolean)[] +>["hello", ...a, true] : (string | number | boolean)[] +>"hello" : "hello" +>...a : number +>a : number[] +>true : true + + var b: (string | number | boolean)[]; +>b : (string | number | boolean)[] +} + +function f2() { +>f2 : () => void + + var a = [...[...[...[...[...[]]]]]]; +>a : any[] +>[...[...[...[...[...[]]]]]] : undefined[] +>...[...[...[...[...[]]]]] : undefined +>[...[...[...[...[]]]]] : undefined[] +>...[...[...[...[]]]] : undefined +>[...[...[...[]]]] : undefined[] +>...[...[...[]]] : undefined +>[...[...[]]] : undefined[] +>...[...[]] : undefined +>[...[]] : undefined[] +>...[] : undefined +>[] : undefined[] + + var b = [...[...[...[...[...[5]]]]]]; +>b : number[] +>[...[...[...[...[...[5]]]]]] : number[] +>...[...[...[...[...[5]]]]] : number +>[...[...[...[...[5]]]]] : number[] +>...[...[...[...[5]]]] : number +>[...[...[...[5]]]] : number[] +>...[...[...[5]]] : number +>[...[...[5]]] : number[] +>...[...[5]] : number +>[...[5]] : number[] +>...[5] : number +>[5] : number[] +>5 : 5 +} + 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 new file mode 100644 index 00000000000..d9135ed5e5c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.asyncArrowFunction11_es5(target=es2015).errors.txt ++++ new.asyncArrowFunction11_es5(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 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. ++ ++ ++!!! 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/asyncArrowFunction11_es5(target=es2015).js b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js new file mode 100644 index 00000000000..bbbf700ba5e --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// + +//// [asyncArrowFunction11_es5.ts] +// 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 + }; +} + +//// [asyncArrowFunction11_es5.js] +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +// https://github.com/Microsoft/TypeScript/issues/24722 +class A { + b = (...args) => __awaiter(this, void 0, void 0, function* () { + yield Promise.resolve(); + const obj = { ["a"]: () => this }; // computed property name after `await` triggers case + }); +} diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff new file mode 100644 index 00000000000..eefeb6dbbae --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).js.diff @@ -0,0 +1,17 @@ +--- old.asyncArrowFunction11_es5(target=es2015).js ++++ new.asyncArrowFunction11_es5(target=es2015).js +@@= skipped -21, +21 lines =@@ + }; + // https://github.com/Microsoft/TypeScript/issues/24722 + class A { +- constructor() { +- this.b = (...args) => __awaiter(this, void 0, void 0, function* () { +- yield Promise.resolve(); +- const obj = { ["a"]: () => this }; // computed property name after `await` triggers case +- }); +- } ++ b = (...args) => __awaiter(this, void 0, void 0, function* () { ++ yield 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).symbols b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols new file mode 100644 index 00000000000..9485f0a7b30 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).symbols @@ -0,0 +1,24 @@ +//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// + +=== asyncArrowFunction11_es5.ts === +// https://github.com/Microsoft/TypeScript/issues/24722 +class A { +>A : Symbol(A, Decl(asyncArrowFunction11_es5.ts, 0, 0)) + + b = async (...args: any[]) => { +>b : Symbol(A.b, Decl(asyncArrowFunction11_es5.ts, 1, 9)) +>args : Symbol(args, Decl(asyncArrowFunction11_es5.ts, 2, 15)) + + await Promise.resolve(); +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + + const obj = { ["a"]: () => this }; // computed property name after `await` triggers case +>obj : Symbol(obj, Decl(asyncArrowFunction11_es5.ts, 4, 13)) +>["a"] : Symbol(["a"], Decl(asyncArrowFunction11_es5.ts, 4, 21)) +>"a" : Symbol(["a"], Decl(asyncArrowFunction11_es5.ts, 4, 21)) +>this : Symbol(A, Decl(asyncArrowFunction11_es5.ts, 0, 0)) + + }; +} diff --git a/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types new file mode 100644 index 00000000000..3785693ae9a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/asyncArrowFunction11_es5(target=es2015).types @@ -0,0 +1,29 @@ +//// [tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction11_es5.ts] //// + +=== asyncArrowFunction11_es5.ts === +// https://github.com/Microsoft/TypeScript/issues/24722 +class A { +>A : A + + b = async (...args: any[]) => { +>b : (...args: any[]) => Promise +>async (...args: any[]) => { await Promise.resolve(); const obj = { ["a"]: () => this }; // computed property name after `await` triggers case } : (...args: any[]) => Promise +>args : any[] + + await Promise.resolve(); +>await Promise.resolve() : void +>Promise.resolve() : Promise +>Promise.resolve : { (): Promise; (value: T): Promise>; (value: T | PromiseLike): Promise>; } +>Promise : PromiseConstructor +>resolve : { (): Promise; (value: T): Promise>; (value: T | PromiseLike): Promise>; } + + const obj = { ["a"]: () => this }; // computed property name after `await` triggers case +>obj : { a: () => this; } +>{ ["a"]: () => this } : { a: () => this; } +>["a"] : () => this +>"a" : "a" +>() => this : () => this +>this : this + + }; +} diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt new file mode 100644 index 00000000000..6265bfb7810 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@ -0,0 +1,67 @@ +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 + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + + // In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. + // An expression of type S is considered assignable to an assignment target V if one of the following is true + + // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, + // S is the type Any, or + + var [a0, a1]: any = undefined; + var [a2 = false, a3 = 1]: any = undefined; + + // V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, + // S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, + // where N is the numeric index of E in the array assignment pattern, or + var [b0, b1, b2] = [2, 3, 4]; + var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + + function foo() { + return [1, 2, 3]; + } + + var [b6, b7] = foo(); + var [...b8] = foo(); + + // S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. + var temp = [1,2,3] + var [c0, c1] = [...temp]; + var [c2] = []; + ~~ +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. + var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] + ~~ +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. + ~~ +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. + var [[c5], c6]: [[string|number], boolean] = [[1], true]; + var [, c7] = [1, 2, 3]; + var [,,, c8] = [1, 2, 3, 4]; + var [,,, c9] = [1, 2, 3, 4]; + var [,,,...c10] = [1, 2, 3, 4, "hello"]; + var [c11, c12, ...c13] = [1, 2, "string"]; + var [c14, c15, c16] = [1, 2, "string"]; + + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff new file mode 100644 index 00000000000..4701a179086 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt.diff @@ -0,0 +1,15 @@ +--- old.destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt ++++ 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/destructuringArrayBindingPatternAndAssignment1ES5iterable.js b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js new file mode 100644 index 00000000000..af3ea7aa075 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.js @@ -0,0 +1,103 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// + +//// [destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is the type Any, or + +var [a0, a1]: any = undefined; +var [a2 = false, a3 = 1]: any = undefined; + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; + +function foo() { + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +var [...b8] = foo(); + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [,,, c8] = [1, 2, 3, 4]; +var [,,, c9] = [1, 2, 3, 4]; +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; + + + +//// [destructuringArrayBindingPatternAndAssignment1ES5iterable.js] +"use strict"; +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is the type Any, or +var [a0, a1] = undefined; +var [a2 = false, a3 = 1] = undefined; +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +var [b3, b4, b5] = [1, 2, "string"]; +function foo() { + return [1, 2, 3]; +} +var [b6, b7] = foo(); +var [...b8] = foo(); +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1, 2, 3]; +var [c0, c1] = [...temp]; +var [c2] = []; +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]; +var [[c5], c6] = [[1], true]; +var [, c7] = [1, 2, 3]; +var [, , , c8] = [1, 2, 3, 4]; +var [, , , c9] = [1, 2, 3, 4]; +var [, , , ...c10] = [1, 2, 3, 4, "hello"]; +var [c11, c12, ...c13] = [1, 2, "string"]; +var [c14, c15, c16] = [1, 2, "string"]; diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols new file mode 100644 index 00000000000..a55d4786324 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.symbols @@ -0,0 +1,107 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// + +=== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts === +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is the type Any, or + +var [a0, a1]: any = undefined; +>a0 : Symbol(a0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 23, 5)) +>a1 : Symbol(a1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 23, 8)) +>undefined : Symbol(undefined) + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : Symbol(a2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 24, 5)) +>a3 : Symbol(a3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 24, 16)) +>undefined : Symbol(undefined) + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : Symbol(b0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 5)) +>b1 : Symbol(b1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 8)) +>b2 : Symbol(b2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 29, 12)) + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : Symbol(b3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 5)) +>b4 : Symbol(b4, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 8)) +>b5 : Symbol(b5, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 12)) + +function foo() { +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) + + return [1, 2, 3]; +} + +var [b6, b7] = foo(); +>b6 : Symbol(b6, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 36, 5)) +>b7 : Symbol(b7, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 36, 8)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) + +var [...b8] = foo(); +>b8 : Symbol(b8, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 37, 5)) +>foo : Symbol(foo, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 30, 62)) + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 40, 3)) + +var [c0, c1] = [...temp]; +>c0 : Symbol(c0, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 41, 5)) +>c1 : Symbol(c1, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 41, 8)) +>temp : Symbol(temp, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 40, 3)) + +var [c2] = []; +>c2 : Symbol(c2, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 42, 5)) + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : Symbol(c3, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 43, 7)) +>c4 : Symbol(c4, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 43, 17)) + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : Symbol(c5, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 44, 6)) +>c6 : Symbol(c6, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 44, 10)) + +var [, c7] = [1, 2, 3]; +>c7 : Symbol(c7, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 45, 6)) + +var [,,, c8] = [1, 2, 3, 4]; +>c8 : Symbol(c8, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 46, 8)) + +var [,,, c9] = [1, 2, 3, 4]; +>c9 : Symbol(c9, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 47, 8)) + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +>c10 : Symbol(c10, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 48, 8)) + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : Symbol(c11, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 5)) +>c12 : Symbol(c12, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 9)) +>c13 : Symbol(c13, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 49, 14)) + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : Symbol(c14, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 5)) +>c15 : Symbol(c15, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 9)) +>c16 : Symbol(c16, Decl(destructuringArrayBindingPatternAndAssignment1ES5iterable.ts, 50, 14)) + + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types new file mode 100644 index 00000000000..e50b1b97b7a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment1ES5iterable.types @@ -0,0 +1,169 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts] //// + +=== destructuringArrayBindingPatternAndAssignment1ES5iterable.ts === +/* AssignmentPattern: + * ObjectAssignmentPattern + * ArrayAssignmentPattern + * ArrayAssignmentPattern: + * [Elision AssignmentRestElementopt ] + * [AssignmentElementList] + * [AssignmentElementList, Elision AssignmentRestElementopt ] + * AssignmentElementList: + * Elision AssignmentElement + * AssignmentElementList, Elisionopt AssignmentElement + * AssignmentElement: + * LeftHandSideExpression Initialiseropt + * AssignmentPattern Initialiseropt + * AssignmentRestElement: + * ... LeftHandSideExpression + */ + +// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left. +// An expression of type S is considered assignable to an assignment target V if one of the following is true + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is the type Any, or + +var [a0, a1]: any = undefined; +>a0 : any +>a1 : any +>undefined : undefined + +var [a2 = false, a3 = 1]: any = undefined; +>a2 : any +>false : false +>a3 : any +>1 : 1 +>undefined : undefined + +// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V, +// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E, +// where N is the numeric index of E in the array assignment pattern, or +var [b0, b1, b2] = [2, 3, 4]; +>b0 : number +>b1 : number +>b2 : number +>[2, 3, 4] : [number, number, number] +>2 : 2 +>3 : 3 +>4 : 4 + +var [b3, b4, b5]: [number, number, string] = [1, 2, "string"]; +>b3 : number +>b4 : number +>b5 : string +>[1, 2, "string"] : [number, number, string] +>1 : 1 +>2 : 2 +>"string" : "string" + +function foo() { +>foo : () => number[] + + return [1, 2, 3]; +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 +} + +var [b6, b7] = foo(); +>b6 : number +>b7 : number +>foo() : number[] +>foo : () => number[] + +var [...b8] = foo(); +>b8 : number[] +>foo() : number[] +>foo : () => number[] + +// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E. +var temp = [1,2,3] +>temp : number[] +>[1,2,3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + +var [c0, c1] = [...temp]; +>c0 : number +>c1 : number +>[...temp] : number[] +>...temp : number +>temp : number[] + +var [c2] = []; +>c2 : undefined +>[] : [] + +var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] + +var [[c5], c6]: [[string|number], boolean] = [[1], true]; +>c5 : string | number +>c6 : boolean +>[[1], true] : [[number], true] +>[1] : [number] +>1 : 1 +>true : true + +var [, c7] = [1, 2, 3]; +>c7 : number +>[1, 2, 3] : [number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 + +var [,,, c8] = [1, 2, 3, 4]; +>c8 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 + +var [,,, c9] = [1, 2, 3, 4]; +>c9 : number +>[1, 2, 3, 4] : [number, number, number, number] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 + +var [,,,...c10] = [1, 2, 3, 4, "hello"]; +>c10 : [number, string] +>[1, 2, 3, 4, "hello"] : [number, number, number, number, string] +>1 : 1 +>2 : 2 +>3 : 3 +>4 : 4 +>"hello" : "hello" + +var [c11, c12, ...c13] = [1, 2, "string"]; +>c11 : number +>c12 : number +>c13 : [string] +>[1, 2, "string"] : [number, number, string] +>1 : 1 +>2 : 2 +>"string" : "string" + +var [c14, c15, c16] = [1, 2, "string"]; +>c14 : number +>c15 : number +>c16 : string +>[1, 2, "string"] : [number, number, string] +>1 : 1 +>2 : 2 +>"string" : "string" + + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt new file mode 100644 index 00000000000..f3581f6522c --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt @@ -0,0 +1,14 @@ +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 + + + declare const data: number[] | null; + const [value] = data; // Error + ~~~~~~~ +!!! error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. + \ No newline at end of file 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 new file mode 100644 index 00000000000..82b0afd4640 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt.diff @@ -0,0 +1,23 @@ +--- old.destructuringArrayBindingPatternAndAssignment4(target=es2015).errors.txt ++++ new.destructuringArrayBindingPatternAndAssignment4(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. +-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. ++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, +9 lines =@@ + declare const data: number[] | null; + const [value] = data; // Error + ~~~~~~~ +-!!! error TS2488: Type 'number[] | null' must have a '[Symbol.iterator]()' method that returns an iterator. ++!!! error TS2488: Type 'null' must have a '[Symbol.iterator]()' method that returns an iterator. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js new file mode 100644 index 00000000000..a8d7f94dd89 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).js @@ -0,0 +1,14 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// + +//// [destructuringArrayBindingPatternAndAssignment4.ts] +// #35497 + + +declare const data: number[] | null; +const [value] = data; // Error + + +//// [destructuringArrayBindingPatternAndAssignment4.js] +"use strict"; +// #35497 +const [value] = data; // Error diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols new file mode 100644 index 00000000000..0cf3f1fb1dc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).symbols @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// + +=== destructuringArrayBindingPatternAndAssignment4.ts === +// #35497 + + +declare const data: number[] | null; +>data : Symbol(data, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 3, 13)) + +const [value] = data; // Error +>value : Symbol(value, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 4, 7)) +>data : Symbol(data, Decl(destructuringArrayBindingPatternAndAssignment4.ts, 3, 13)) + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types new file mode 100644 index 00000000000..50fab237f32 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment4.ts] //// + +=== destructuringArrayBindingPatternAndAssignment4.ts === +// #35497 + + +declare const data: number[] | null; +>data : number[] | null + +const [value] = data; // Error +>value : number +>data : number[] | null + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff new file mode 100644 index 00000000000..e0be89f5101 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringArrayBindingPatternAndAssignment4(target=es2015).types.diff @@ -0,0 +1,9 @@ +--- old.destructuringArrayBindingPatternAndAssignment4(target=es2015).types ++++ new.destructuringArrayBindingPatternAndAssignment4(target=es2015).types +@@= skipped -7, +7 lines =@@ + >data : number[] | null + + const [value] = data; // Error +->value : any ++>value : number + >data : number[] | null diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt new file mode 100644 index 00000000000..206834b5bbb --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt @@ -0,0 +1,286 @@ +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. +destructuringParameterDeclaration1ES5iterable.ts(23,8): error TS7006: Parameter 'z' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,11): error TS7006: Parameter 'y' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,17): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,20): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,25): error TS7031: Binding element 'p' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,33): error TS7031: Binding element 'q' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(23,36): error TS7031: Binding element 'r' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(29,5): error TS2322: Type 'number' is not assignable to type 'null | undefined'. +destructuringParameterDeclaration1ES5iterable.ts(29,8): error TS2322: Type 'number' is not assignable to type 'null | undefined'. +destructuringParameterDeclaration1ES5iterable.ts(29,11): error TS2322: Type 'number' is not assignable to type 'null | undefined'. +destructuringParameterDeclaration1ES5iterable.ts(30,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. +destructuringParameterDeclaration1ES5iterable.ts(31,4): error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. +destructuringParameterDeclaration1ES5iterable.ts(32,5): error TS2322: Type 'string' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(32,15): error TS2322: Type 'number' is not assignable to type 'null'. +destructuringParameterDeclaration1ES5iterable.ts(32,18): error TS2322: Type 'number' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(33,6): error TS2322: Type 'string' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(33,17): error TS2322: Type 'number' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(33,22): error TS2322: Type 'true' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(33,28): error TS2322: Type 'false' is not assignable to type 'undefined'. +destructuringParameterDeclaration1ES5iterable.ts(38,18): error TS7031: Binding element 'x' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(38,25): error TS7031: Binding element 'j' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(42,14): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(42,17): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(42,22): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(43,14): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(43,17): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(57,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. +destructuringParameterDeclaration1ES5iterable.ts(62,10): error TS2393: Duplicate function implementation. +destructuringParameterDeclaration1ES5iterable.ts(62,13): error TS7006: Parameter 'x' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(63,10): error TS2393: Duplicate function implementation. +destructuringParameterDeclaration1ES5iterable.ts(66,5): error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type. +destructuringParameterDeclaration1ES5iterable.ts(66,9): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(66,12): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(66,15): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(67,5): error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type. +destructuringParameterDeclaration1ES5iterable.ts(67,9): error TS7031: Binding element 'x' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(67,12): error TS7031: Binding element 'y' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(67,15): error TS7031: Binding element 'z' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(68,5): error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type. +destructuringParameterDeclaration1ES5iterable.ts(68,9): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(68,12): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(68,15): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(75,9): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(75,12): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(75,15): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(79,9): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(79,12): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(79,15): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(80,9): error TS7031: Binding element 'x' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(80,12): error TS7031: Binding element 'y' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(80,15): error TS7031: Binding element 'z' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(81,9): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(81,12): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(81,15): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(92,17): error TS7031: Binding element 'number' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(95,18): error TS7031: Binding element 'number' implicitly has an 'any' type. +destructuringParameterDeclaration1ES5iterable.ts(95,25): error TS7031: Binding element 'string' implicitly has an 'any' type. +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 + // in a parameter list must be unique within that parameter list. + + // If the declaration includes a type annotation, the parameter is of that type + function a1([a, b, [[c]]]: [number, number, string[][]]) { } + function a2(o: { x: number, a: number }) { } + function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; + function a4({x, a}: { x: number, a: number }) { } + + a1([1, 2, [["world"]]]); + a1([1, 2, [["world"]], 3]); + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, number, string[][], number]' is not assignable to parameter of type '[number, number, string[][]]'. +!!! error TS2345: Source has 4 element(s) but target allows only 3. + + // If the declaration includes an initializer expression (which is permitted only + // when the parameter list occurs in conjunction with a function body), + // the parameter type is the widened form (section 3.11) of the type of the initializer expression. + + function b1(z = [undefined, null]) { }; + function b2(z = null, o = { x: 0, y: undefined }) { } + function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + + interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7010: 'b5', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! error TS7006: Parameter 'z' implicitly has an 'any' type. + ~ +!!! error TS7006: Parameter 'y' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'p' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'q' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'r' implicitly has an 'any' type. + } + + function b6([a, z, y] = [undefined, null, undefined]) { } + function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + + b1([1, 2, 3]); // z is widen to the type any[] + ~ +!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'null | undefined'. + b2("string", { x: 200, y: "string" }); + ~~~~~~~~ +!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. + b2("string", { x: 200, y: true }); + ~~~~~~~~ +!!! error TS2345: Argument of type '"string"' is not assignable to parameter of type 'null | undefined'. + b6(["string", 1, 2]); // Shouldn't be an error + ~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'undefined'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'null'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'undefined'. + b7([["string"], 1, [[true, false]]]); // Shouldn't be an error + ~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'undefined'. + ~ +!!! error TS2322: Type 'number' is not assignable to type 'undefined'. + ~~~~ +!!! error TS2322: Type 'true' is not assignable to type 'undefined'. + ~~~~~ +!!! error TS2322: Type 'false' is not assignable to type 'undefined'. + + + // If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) + enum Foo { a } + function c0({z: {x, y: {j}}}) { } + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'j' implicitly has an 'any' type. + function c1({z} = { z: 10 }) { } + function c2({z = 10}) { } + function c3({b}: { b: number|string} = { b: "hello" }) { } + function c5([a, b, [[c]]]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + function c6([a, b, [[c=1]]]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + + c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } + c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + + c1(); // Implied type is {z:number}? + c1({ z: 1 }) // Implied type is {z:number}? + + c2({}); // Implied type is {z?: number} + c2({z:1}); // Implied type is {z?: number} + + c3({ b: 1 }); // Implied type is { b: number|string }. + + c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] + c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. +!!! error TS2345: Source has 5 element(s) but target allows only 3. + + // A parameter can be marked optional by following its name or binding pattern with a question mark (?) + // or by including an initializer. + + function d0(x?) { } + ~~ +!!! error TS2393: Duplicate function implementation. + ~~ +!!! error TS7006: Parameter 'x' implicitly has an 'any' type. + function d0(x = 10) { } + ~~ +!!! error TS2393: Duplicate function implementation. + + interface F2 { + d3([a, b, c]?); + ~~~~~~~~~~~~~~~ +!!! error TS7010: 'd3', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + d4({x, y, z}?); + ~~~~~~~~~~~~~~~ +!!! error TS7010: 'd4', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'z' implicitly has an 'any' type. + e0([a, b, c]); + ~~~~~~~~~~~~~~ +!!! error TS7010: 'e0', which lacks return-type annotation, implicitly has an 'any' return type. + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + } + + class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + } + + class C3 implements F2 { + d3([a, b, c]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + d4({x, y, z}) { } + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'z' implicitly has an 'any' type. + e0([a, b, c]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + } + + + function d5({x, y} = { x: 1, y: 2 }) { } + d5(); // Parameter is optional as its declaration included an initializer + + // Destructuring parameter declarations do not permit type annotations on the individual binding patterns, + // as such annotations would conflict with the already established meaning of colons in object literals. + // Type annotations must instead be written on the top- level parameter declaration + + function e1({x: number}) { } // x has type any NOT number + ~~~~~~ +!!! error TS7031: Binding element 'number' implicitly has an 'any' type. + function e2({x}: { x: number }) { } // x is type number + function e3({x}: { x?: number }) { } // x is an optional with type number + function e4({x: [number,string,any] }) { } // x has type [any, any, any] + ~~~~~~ +!!! error TS7031: Binding element 'number' implicitly has an 'any' type. + ~~~~~~ +!!! error TS7031: Binding element 'string' implicitly has an 'any' type. + ~~~ +!!! error TS7031: Binding element 'any' implicitly has an 'any' type. + function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff new file mode 100644 index 00000000000..46ca81b53e8 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.destructuringParameterDeclaration1ES5iterable.errors.txt ++++ 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, +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/destructuringParameterDeclaration1ES5iterable.js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js new file mode 100644 index 00000000000..07e3ef253de --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.js @@ -0,0 +1,173 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// + +//// [destructuringParameterDeclaration1ES5iterable.ts] +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +function a2(o: { x: number, a: number }) { } +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +function a4({x, a}: { x: number, a: number }) { } + +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } + +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +b6(["string", 1, 2]); // Shouldn't be an error +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +function c0({z: {x, y: {j}}}) { } +function c1({z} = { z: 10 }) { } +function c2({z = 10}) { } +function c3({b}: { b: number|string} = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c=1]]]) { } + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } + +c1(); // Implied type is {z:number}? +c1({ z: 1 }) // Implied type is {z:number}? + +c2({}); // Implied type is {z?: number} +c2({z:1}); // Implied type is {z?: number} + +c3({ b: 1 }); // Implied type is { b: number|string }. + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +function d0(x?) { } +function d0(x = 10) { } + +interface F2 { + d3([a, b, c]?); + d4({x, y, z}?); + e0([a, b, c]); +} + +class C2 implements F2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} + +class C3 implements F2 { + d3([a, b, c]) { } + d4({x, y, z}) { } + e0([a, b, c]) { } +} + + +function d5({x, y} = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +function e2({x}: { x: number }) { } // x is type number +function e3({x}: { x?: number }) { } // x is an optional with type number +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] + + +//// [destructuringParameterDeclaration1ES5iterable.js] +"use strict"; +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]) { } +function a2(o) { } +function a3({ j, k, l: { m, n }, q: [a, b, c] }) { } +; +function a4({ x, a }) { } +a1([1, 2, [["world"]]]); +a1([1, 2, [["world"]], 3]); +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. +function b1(z = [undefined, null]) { } +; +function b2(z = null, o = { x: 0, y: undefined }) { } +function b3({ z: { x, y: { j } } } = { z: { x: "hi", y: { j: 1 } } }) { } +function b6([a, z, y] = [undefined, null, undefined]) { } +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +b1([1, 2, 3]); // z is widen to the type any[] +b2("string", { x: 200, y: "string" }); +b2("string", { x: 200, y: true }); +b6(["string", 1, 2]); // Shouldn't be an error +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +var Foo; +(function (Foo) { + Foo[Foo["a"] = 0] = "a"; +})(Foo || (Foo = {})); +function c0({ z: { x, y: { j } } }) { } +function c1({ z } = { z: 10 }) { } +function c2({ z = 10 }) { } +function c3({ b } = { b: "hello" }) { } +function c5([a, b, [[c]]]) { } +function c6([a, b, [[c = 1]]]) { } +c0({ z: { x: 1, y: { j: "world" } } }); // Implied type is { z: {x: any, y: {j: any}} } +c0({ z: { x: "string", y: { j: true } } }); // Implied type is { z: {x: any, y: {j: any}} } +c1(); // Implied type is {z:number}? +c1({ z: 1 }); // Implied type is {z:number}? +c2({}); // Implied type is {z?: number} +c2({ z: 1 }); // Implied type is {z?: number} +c3({ b: 1 }); // Implied type is { b: number|string }. +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. +function d0(x) { } +function d0(x = 10) { } +class C2 { + constructor() { } + d3() { } + d4() { } + e0([a, b, c]) { } +} +class C3 { + d3([a, b, c]) { } + d4({ x, y, z }) { } + e0([a, b, c]) { } +} +function d5({ x, y } = { x: 1, y: 2 }) { } +d5(); // Parameter is optional as its declaration included an initializer +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration +function e1({ x: number }) { } // x has type any NOT number +function e2({ x }) { } // x is type number +function e3({ x }) { } // x is an optional with type number +function e4({ x: [number, string, any] }) { } // x has type [any, any, any] +function e5({ x: [a, b, c] }) { } // x has type [any, any, any] diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols new file mode 100644 index 00000000000..3f733d683d9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.symbols @@ -0,0 +1,329 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// + +=== destructuringParameterDeclaration1ES5iterable.ts === +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 21)) + +function a2(o: { x: number, a: number }) { } +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 5, 60)) +>o : Symbol(o, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 12)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 16)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 27)) + +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +>a3 : Symbol(a3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 6, 44)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 13)) +>k : Symbol(k, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 15)) +>l : Symbol(l, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 68)) +>m : Symbol(m, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 23)) +>n : Symbol(n, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 25)) +>q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 98)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 34)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 36)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 39)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 46)) +>k : Symbol(k, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 57)) +>l : Symbol(l, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 68)) +>m : Symbol(m, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 73)) +>n : Symbol(n, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 85)) +>q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 98)) + +function a4({x, a}: { x: number, a: number }) { } +>a4 : Symbol(a4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 7, 127)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 13)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 15)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 8, 32)) + +a1([1, 2, [["world"]]]); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) + +a1([1, 2, [["world"]], 3]); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 0, 0)) + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 11, 27)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 12)) +>undefined : Symbol(undefined) + +function b2(z = null, o = { x: 0, y: undefined }) { } +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 12)) +>o : Symbol(o, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 21)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 27)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 33)) +>undefined : Symbol(undefined) + +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } +>b3 : Symbol(b3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 18, 53)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 32)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 17)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 46)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 24)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 32)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 37)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 46)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 51)) + +interface F1 { +>F1 : Symbol(F1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 19, 67)) + + b5(z, y, [, a, b], {p, m: { q, r}}); +>b5 : Symbol(F1.b5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 21, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 7)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 9)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 15)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 18)) +>p : Symbol(p, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 24)) +>m : Symbol(m) +>q : Symbol(q, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 31)) +>r : Symbol(r, Decl(destructuringParameterDeclaration1ES5iterable.ts, 22, 34)) +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +>b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 23, 1)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 13)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 15)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 18)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +>b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 57)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 17)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 23)) +>d : Symbol(d, Decl(destructuringParameterDeclaration1ES5iterable.ts, 26, 25)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) + +b1([1, 2, 3]); // z is widen to the type any[] +>b1 : Symbol(b1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 11, 27)) + +b2("string", { x: 200, y: "string" }); +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 29, 14)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 29, 22)) + +b2("string", { x: 200, y: true }); +>b2 : Symbol(b2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 17, 39)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 30, 14)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 30, 22)) + +b6(["string", 1, 2]); // Shouldn't be an error +>b6 : Symbol(b6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 23, 1)) + +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error +>b7 : Symbol(b7, Decl(destructuringParameterDeclaration1ES5iterable.ts, 25, 57)) + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +>Foo : Symbol(Foo, Decl(destructuringParameterDeclaration1ES5iterable.ts, 32, 37)) +>a : Symbol(Foo.a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 10)) + +function c0({z: {x, y: {j}}}) { } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) +>z : Symbol(z) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 17)) +>y : Symbol(y) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 24)) + +function c1({z} = { z: 10 }) { } +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 13)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 19)) + +function c2({z = 10}) { } +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 13)) + +function c3({b}: { b: number|string} = { b: "hello" }) { } +>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 25)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 18)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 40)) + +function c5([a, b, [[c]]]) { } +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 21)) + +function c6([a, b, [[c=1]]]) { } +>c6 : Symbol(c6, Decl(destructuringParameterDeclaration1ES5iterable.ts, 41, 30)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 42, 21)) + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 4)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 9)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 15)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 44, 20)) + +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0 : Symbol(c0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 36, 14)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 4)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 9)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 22)) +>j : Symbol(j, Decl(destructuringParameterDeclaration1ES5iterable.ts, 45, 27)) + +c1(); // Implied type is {z:number}? +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) + +c1({ z: 1 }) // Implied type is {z:number}? +>c1 : Symbol(c1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 37, 33)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 48, 4)) + +c2({}); // Implied type is {z?: number} +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) + +c2({z:1}); // Implied type is {z?: number} +>c2 : Symbol(c2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 38, 32)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 51, 4)) + +c3({ b: 1 }); // Implied type is { b: number|string }. +>c3 : Symbol(c3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 39, 25)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 53, 4)) + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) + +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +>c5 : Symbol(c5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 40, 58)) + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +function d0(x?) { } +>d0 : Symbol(d0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 56, 38), Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 12)) + +function d0(x = 10) { } +>d0 : Symbol(d0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 56, 38), Decl(destructuringParameterDeclaration1ES5iterable.ts, 61, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 12)) + +interface F2 { +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) + + d3([a, b, c]?); +>d3 : Symbol(F2.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 64, 14)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 13)) + + d4({x, y, z}?); +>d4 : Symbol(F2.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 65, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 8)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 10)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 13)) + + e0([a, b, c]); +>e0 : Symbol(F2.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 66, 19)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 67, 13)) +} + +class C2 implements F2 { +>C2 : Symbol(C2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 68, 1)) +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) + + constructor() { } + d3() { } +>d3 : Symbol(C2.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 71, 21)) + + d4() { } +>d4 : Symbol(C2.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 72, 12)) + + e0([a, b, c]) { } +>e0 : Symbol(C2.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 73, 12)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 74, 13)) +} + +class C3 implements F2 { +>C3 : Symbol(C3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 75, 1)) +>F2 : Symbol(F2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 62, 23)) + + d3([a, b, c]) { } +>d3 : Symbol(C3.d3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 77, 24)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 13)) + + d4({x, y, z}) { } +>d4 : Symbol(C3.d4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 78, 21)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 8)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 10)) +>z : Symbol(z, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 13)) + + e0([a, b, c]) { } +>e0 : Symbol(C3.e0, Decl(destructuringParameterDeclaration1ES5iterable.ts, 79, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 8)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 10)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 80, 13)) +} + + +function d5({x, y} = { x: 1, y: 2 }) { } +>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 81, 1)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 13)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 15)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 22)) +>y : Symbol(y, Decl(destructuringParameterDeclaration1ES5iterable.ts, 84, 28)) + +d5(); // Parameter is optional as its declaration included an initializer +>d5 : Symbol(d5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 81, 1)) + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +>e1 : Symbol(e1, Decl(destructuringParameterDeclaration1ES5iterable.ts, 85, 5)) +>x : Symbol(x) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES5iterable.ts, 91, 13)) + +function e2({x}: { x: number }) { } // x is type number +>e2 : Symbol(e2, Decl(destructuringParameterDeclaration1ES5iterable.ts, 91, 28)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 13)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 18)) + +function e3({x}: { x?: number }) { } // x is an optional with type number +>e3 : Symbol(e3, Decl(destructuringParameterDeclaration1ES5iterable.ts, 92, 35)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 13)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 18)) + +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +>e4 : Symbol(e4, Decl(destructuringParameterDeclaration1ES5iterable.ts, 93, 36)) +>x : Symbol(x) +>number : Symbol(number, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 17)) +>string : Symbol(string, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 24)) +>any : Symbol(any, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 31)) + +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] +>e5 : Symbol(e5, Decl(destructuringParameterDeclaration1ES5iterable.ts, 94, 42)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 29)) +>a : Symbol(a, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 17)) +>b : Symbol(b, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 19)) +>c : Symbol(c, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 22)) +>x : Symbol(x, Decl(destructuringParameterDeclaration1ES5iterable.ts, 95, 29)) + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types new file mode 100644 index 00000000000..ffb2d81395b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types @@ -0,0 +1,431 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration1ES5iterable.ts] //// + +=== destructuringParameterDeclaration1ES5iterable.ts === +// A parameter declaration may specify either an identifier or a binding pattern. +// The identifiers specified in parameter declarations and binding patterns +// in a parameter list must be unique within that parameter list. + +// If the declaration includes a type annotation, the parameter is of that type +function a1([a, b, [[c]]]: [number, number, string[][]]) { } +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>a : number +>b : number +>c : string + +function a2(o: { x: number, a: number }) { } +>a2 : (o: { x: number; a: number; }) => void +>o : { x: number; a: number; } +>x : number +>a : number + +function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +>a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void +>j : number +>k : string +>l : any +>m : boolean +>n : number +>q : any +>a : string | number +>b : string | number +>c : string | number +>j : number +>k : string +>l : { m: boolean; n: number; } +>m : boolean +>n : number +>q : (string | number)[] + +function a4({x, a}: { x: number, a: number }) { } +>a4 : ({ x, a }: { x: number; a: number; }) => void +>x : number +>a : number +>x : number +>a : number + +a1([1, 2, [["world"]]]); +>a1([1, 2, [["world"]]]) : void +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>[1, 2, [["world"]]] : [number, number, string[][]] +>1 : 1 +>2 : 2 +>[["world"]] : string[][] +>["world"] : string[] +>"world" : "world" + +a1([1, 2, [["world"]], 3]); +>a1([1, 2, [["world"]], 3]) : void +>a1 : ([a, b, [[c]]]: [number, number, string[][]]) => void +>[1, 2, [["world"]], 3] : [number, number, string[][], number] +>1 : 1 +>2 : 2 +>[["world"]] : string[][] +>["world"] : string[] +>"world" : "world" +>3 : 3 + +// If the declaration includes an initializer expression (which is permitted only +// when the parameter list occurs in conjunction with a function body), +// the parameter type is the widened form (section 3.11) of the type of the initializer expression. + +function b1(z = [undefined, null]) { }; +>b1 : (z?: (null | undefined)[]) => void +>z : (null | undefined)[] +>[undefined, null] : (null | undefined)[] +>undefined : undefined + +function b2(z = null, o = { x: 0, y: undefined }) { } +>b2 : (z?: null, o?: { x: number; y: undefined; }) => void +>z : null +>o : { x: number; y: undefined; } +>{ x: 0, y: undefined } : { x: number; y: undefined; } +>x : number +>0 : 0 +>y : undefined +>undefined : undefined + +function b3({z: {x, y: {j}}} = { z: { x: "hi", y: { j: 1 } } }) { } +>b3 : ({ z: { x, y: { j } } }?: { z: { x: string; y: { j: number; }; }; }) => void +>z : any +>x : string +>y : any +>j : number +>{ z: { x: "hi", y: { j: 1 } } } : { z: { x: string; y: { j: number; }; }; } +>z : { x: string; y: { j: number; }; } +>{ x: "hi", y: { j: 1 } } : { x: string; y: { j: number; }; } +>x : string +>"hi" : "hi" +>y : { j: number; } +>{ j: 1 } : { j: number; } +>j : number +>1 : 1 + +interface F1 { + b5(z, y, [, a, b], {p, m: { q, r}}); +>b5 : (z: any, y: any, [, a, b]: [any, any, any], { p, m: { q, r } }: { m: { q: any; r: any; }; p: any; }) => any +>z : any +>y : any +>a : any +>b : any +>p : any +>m : any +>q : any +>r : any +} + +function b6([a, z, y] = [undefined, null, undefined]) { } +>b6 : ([a, z, y]?: [undefined, null, undefined]) => void +>a : undefined +>z : null +>y : undefined +>[undefined, null, undefined] : [undefined, null, undefined] +>undefined : undefined +>undefined : undefined + +function b7([[a], b, [[c, d]]] = [[undefined], undefined, [[undefined, undefined]]]) { } +>b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void +>a : undefined +>b : undefined +>c : undefined +>d : undefined +>[[undefined], undefined, [[undefined, undefined]]] : [[undefined], undefined, [[undefined, undefined]]] +>[undefined] : [undefined] +>undefined : undefined +>undefined : undefined +>[[undefined, undefined]] : [[undefined, undefined]] +>[undefined, undefined] : [undefined, undefined] +>undefined : undefined +>undefined : undefined + +b1([1, 2, 3]); // z is widen to the type any[] +>b1([1, 2, 3]) : void +>b1 : (z?: (null | undefined)[]) => void +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + +b2("string", { x: 200, y: "string" }); +>b2("string", { x: 200, y: "string" }) : void +>b2 : (z?: null, o?: { x: number; y: undefined; }) => void +>"string" : "string" +>{ x: 200, y: "string" } : { x: number; y: string; } +>x : number +>200 : 200 +>y : string +>"string" : "string" + +b2("string", { x: 200, y: true }); +>b2("string", { x: 200, y: true }) : void +>b2 : (z?: null, o?: { x: number; y: undefined; }) => void +>"string" : "string" +>{ x: 200, y: true } : { x: number; y: boolean; } +>x : number +>200 : 200 +>y : boolean +>true : true + +b6(["string", 1, 2]); // Shouldn't be an error +>b6(["string", 1, 2]) : void +>b6 : ([a, z, y]?: [undefined, null, undefined]) => void +>["string", 1, 2] : [string, number, number] +>"string" : "string" +>1 : 1 +>2 : 2 + +b7([["string"], 1, [[true, false]]]); // Shouldn't be an error +>b7([["string"], 1, [[true, false]]]) : void +>b7 : ([[a], b, [[c, d]]]?: [[undefined], undefined, [[undefined, undefined]]]) => void +>[["string"], 1, [[true, false]]] : [[string], number, [[boolean, boolean]]] +>["string"] : [string] +>"string" : "string" +>1 : 1 +>[[true, false]] : [[boolean, boolean]] +>[true, false] : [boolean, boolean] +>true : true +>false : false + + +// If the declaration specifies a binding pattern, the parameter type is the implied type of that binding pattern (section 5.1.3) +enum Foo { a } +>Foo : Foo +>a : Foo.a + +function c0({z: {x, y: {j}}}) { } +>c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void +>z : any +>x : any +>y : any +>j : any + +function c1({z} = { z: 10 }) { } +>c1 : ({ z }?: { z: number; }) => void +>z : number +>{ z: 10 } : { z: number; } +>z : number +>10 : 10 + +function c2({z = 10}) { } +>c2 : ({ z }: { z?: number | undefined; }) => void +>z : number +>10 : 10 + +function c3({b}: { b: number|string} = { b: "hello" }) { } +>c3 : ({ b }?: { b: string | number; }) => void +>b : string | number +>b : string | number +>{ b: "hello" } : { b: string; } +>b : string +>"hello" : "hello" + +function c5([a, b, [[c]]]) { } +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>a : any +>b : any +>c : any + +function c6([a, b, [[c=1]]]) { } +>c6 : ([a, b, [[c]]]: [any, any, [[(number | undefined)?]]]) => void +>a : any +>b : any +>c : number +>1 : 1 + +c0({z : { x: 1, y: { j: "world" } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0({z : { x: 1, y: { j: "world" } }}) : void +>c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void +>{z : { x: 1, y: { j: "world" } }} : { z: { x: number; y: { j: string; }; }; } +>z : { x: number; y: { j: string; }; } +>{ x: 1, y: { j: "world" } } : { x: number; y: { j: string; }; } +>x : number +>1 : 1 +>y : { j: string; } +>{ j: "world" } : { j: string; } +>j : string +>"world" : "world" + +c0({z : { x: "string", y: { j: true } }}); // Implied type is { z: {x: any, y: {j: any}} } +>c0({z : { x: "string", y: { j: true } }}) : void +>c0 : ({ z: { x, y: { j } } }: { z: { x: any; y: { j: any; }; }; }) => void +>{z : { x: "string", y: { j: true } }} : { z: { x: string; y: { j: boolean; }; }; } +>z : { x: string; y: { j: boolean; }; } +>{ x: "string", y: { j: true } } : { x: string; y: { j: boolean; }; } +>x : string +>"string" : "string" +>y : { j: boolean; } +>{ j: true } : { j: boolean; } +>j : boolean +>true : true + +c1(); // Implied type is {z:number}? +>c1() : void +>c1 : ({ z }?: { z: number; }) => void + +c1({ z: 1 }) // Implied type is {z:number}? +>c1({ z: 1 }) : void +>c1 : ({ z }?: { z: number; }) => void +>{ z: 1 } : { z: number; } +>z : number +>1 : 1 + +c2({}); // Implied type is {z?: number} +>c2({}) : void +>c2 : ({ z }: { z?: number | undefined; }) => void +>{} : {} + +c2({z:1}); // Implied type is {z?: number} +>c2({z:1}) : void +>c2 : ({ z }: { z?: number | undefined; }) => void +>{z:1} : { z: number; } +>z : number +>1 : 1 + +c3({ b: 1 }); // Implied type is { b: number|string }. +>c3({ b: 1 }) : void +>c3 : ({ b }?: { b: string | number; }) => void +>{ b: 1 } : { b: number; } +>b : number +>1 : 1 + +c5([1, 2, [["string"]]]); // Implied type is is [any, any, [[any]]] +>c5([1, 2, [["string"]]]) : void +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]]] : [number, number, [[string]]] +>1 : 1 +>2 : 2 +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : "string" + +c5([1, 2, [["string"]], false, true]); // Implied type is is [any, any, [[any]]] +>c5([1, 2, [["string"]], false, true]) : void +>c5 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : 1 +>2 : 2 +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : "string" +>false : false +>true : true + +// A parameter can be marked optional by following its name or binding pattern with a question mark (?) +// or by including an initializer. + +function d0(x?) { } +>d0 : (x?: any) => void +>x : any + +function d0(x = 10) { } +>d0 : (x?: any) => void +>x : number +>10 : 10 + +interface F2 { + d3([a, b, c]?); +>d3 : ([a, b, c]?: [any, any, any]) => any +>a : any +>b : any +>c : any + + d4({x, y, z}?); +>d4 : ({ x, y, z }?: { x: any; y: any; z: any; }) => any +>x : any +>y : any +>z : any + + e0([a, b, c]); +>e0 : ([a, b, c]: [any, any, any]) => any +>a : any +>b : any +>c : any +} + +class C2 implements F2 { +>C2 : C2 + + constructor() { } + d3() { } +>d3 : () => void + + d4() { } +>d4 : () => void + + e0([a, b, c]) { } +>e0 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any +} + +class C3 implements F2 { +>C3 : C3 + + d3([a, b, c]) { } +>d3 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any + + d4({x, y, z}) { } +>d4 : ({ x, y, z }: { x: any; y: any; z: any; }) => void +>x : any +>y : any +>z : any + + e0([a, b, c]) { } +>e0 : ([a, b, c]: [any, any, any]) => void +>a : any +>b : any +>c : any +} + + +function d5({x, y} = { x: 1, y: 2 }) { } +>d5 : ({ x, y }?: { x: number; y: number; }) => void +>x : number +>y : number +>{ x: 1, y: 2 } : { x: number; y: number; } +>x : number +>1 : 1 +>y : number +>2 : 2 + +d5(); // Parameter is optional as its declaration included an initializer +>d5() : void +>d5 : ({ x, y }?: { x: number; y: number; }) => void + +// Destructuring parameter declarations do not permit type annotations on the individual binding patterns, +// as such annotations would conflict with the already established meaning of colons in object literals. +// Type annotations must instead be written on the top- level parameter declaration + +function e1({x: number}) { } // x has type any NOT number +>e1 : ({ x: number }: { x: any; }) => void +>x : any +>number : any + +function e2({x}: { x: number }) { } // x is type number +>e2 : ({ x }: { x: number; }) => void +>x : number +>x : number + +function e3({x}: { x?: number }) { } // x is an optional with type number +>e3 : ({ x }: { x?: number | undefined; }) => void +>x : number | undefined +>x : number | undefined + +function e4({x: [number,string,any] }) { } // x has type [any, any, any] +>e4 : ({ x: [number, string, any] }: { x: [any, any, any]; }) => void +>x : any +>number : any +>string : any +>any : any + +function e5({x: [a, b, c]}: { x: [number, number, number] }) { } // x has type [any, any, any] +>e5 : ({ x: [a, b, c] }: { x: [number, number, number]; }) => void +>x : any +>a : number +>b : number +>c : number +>x : [number, number, number] + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff new file mode 100644 index 00000000000..ea762d440dd --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration1ES5iterable.types.diff @@ -0,0 +1,37 @@ +--- old.destructuringParameterDeclaration1ES5iterable.types ++++ new.destructuringParameterDeclaration1ES5iterable.types +@@= skipped -18, +18 lines =@@ + >a : number + + function a3({j, k, l: {m, n}, q: [a, b, c]}: { j: number, k: string, l: { m: boolean, n: number }, q: (number|string)[] }) { }; +->a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (number | string)[]; }) => void ++>a3 : ({ j, k, l: { m, n }, q: [a, b, c] }: { j: number; k: string; l: { m: boolean; n: number; }; q: (string | number)[]; }) => void + >j : number + >k : string + >l : any +@@= skipped -192, +192 lines =@@ + >10 : 10 + + function c3({b}: { b: number|string} = { b: "hello" }) { } +->c3 : ({ b }?: { b: number | string; }) => void ++>c3 : ({ b }?: { b: string | number; }) => void + >b : string | number + >b : string | number + >{ b: "hello" } : { b: string; } +@@= skipped -71, +71 lines =@@ + + c3({ b: 1 }); // Implied type is { b: number|string }. + >c3({ b: 1 }) : void +->c3 : ({ b }?: { b: number | string; }) => void ++>c3 : ({ b }?: { b: string | number; }) => void + >{ b: 1 } : { b: number; } + >b : number + >1 : 1 +@@= skipped -128, +128 lines =@@ + >x : number + + function e3({x}: { x?: number }) { } // x is an optional with type number +->e3 : ({ x }: { x?: number; }) => void ++>e3 : ({ x }: { x?: number | undefined; }) => void + >x : number | undefined + >x : number | undefined diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..feeb3079131 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt @@ -0,0 +1,87 @@ +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. +destructuringParameterDeclaration3ES5iterable.ts(16,22): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration3ES5iterable.ts(17,15): error TS7031: Binding element 'a' implicitly has an 'any' type. +destructuringParameterDeclaration3ES5iterable.ts(17,18): error TS7031: Binding element 'b' implicitly has an 'any' type. +destructuringParameterDeclaration3ES5iterable.ts(17,23): error TS7031: Binding element 'c' implicitly has an 'any' type. +destructuringParameterDeclaration3ES5iterable.ts(17,31): error TS7031: Binding element 'x' implicitly has an 'any' type. +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]]'. +destructuringParameterDeclaration3ES5iterable.ts(30,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]], ...any[]]'. + 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. + + // RestParameter: + // ... Identifier TypeAnnotation(opt) + + type arrayString = Array + type someArray = Array | number[]; + type stringOrNumArray = Array; + + function a1(...x: (number|string)[]) { } + function a2(...a) { } + ~~~~ +!!! error TS7019: Rest parameter 'a' implicitly has an 'any[]' type. + function a3(...a: Array) { } + function a4(...a: arrayString) { } + function a5(...a: stringOrNumArray) { } + function a9([a, b, [[c]]]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + function a10([a, b, [[c]], ...x]) { } + ~ +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. + ~ +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. + function a11([a, b, c, ...x]: number[]) { } + + + var array = [1, 2, 3]; + var array2 = [true, false, "hello"]; + a2([...array]); + a1(...array); + + a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2345: Argument of type '[number, number, [[string]], boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. +!!! error TS2345: Source has 5 element(s) but target allows only 3. + + a10([1, 2, [["string"]], false, true]); // Parameter type is any[] + a10([1, 2, 3, false, true]); // Parameter type is any[] + ~ +!!! error TS2322: Type 'number' is not assignable to type '[[any]]'. + a10([1, 2]); // Parameter type is any[] + ~~~~~~ +!!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type '[any, any, [[any]], ...any[]]'. +!!! error TS2345: Source has 2 element(s) but target requires 3. + a11([1, 2]); // Parameter type is number[] + + // Rest parameter with generic + function foo(...a: T[]) { } + foo("hello", 1, 2); + foo("hello", "world"); + + enum E { a, b } + const enum E1 { a, b } + function foo1(...a: T[]) { } + foo1(1, 2, 3, E.a); + foo1(1, 2, 3, E1.a, E.b); + + + \ No newline at end of file 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 new file mode 100644 index 00000000000..8d36661fc34 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,17 @@ +--- old.destructuringParameterDeclaration3ES5iterable(target=es2015).errors.txt ++++ 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, +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/destructuringParameterDeclaration3ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js new file mode 100644 index 00000000000..43baf42b6ba --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).js @@ -0,0 +1,82 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// + +//// [destructuringParameterDeclaration3ES5iterable.ts] +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +type someArray = Array | number[]; +type stringOrNumArray = Array; + +function a1(...x: (number|string)[]) { } +function a2(...a) { } +function a3(...a: Array) { } +function a4(...a: arrayString) { } +function a5(...a: stringOrNumArray) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]: number[]) { } + + +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] + +// Rest parameter with generic +function foo(...a: T[]) { } +foo("hello", 1, 2); +foo("hello", "world"); + +enum E { a, b } +const enum E1 { a, b } +function foo1(...a: T[]) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, E1.a, E.b); + + + + +//// [destructuringParameterDeclaration3ES5iterable.js] +"use strict"; +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. +function a1(...x) { } +function a2(...a) { } +function a3(...a) { } +function a4(...a) { } +function a5(...a) { } +function a9([a, b, [[c]]]) { } +function a10([a, b, [[c]], ...x]) { } +function a11([a, b, c, ...x]) { } +var array = [1, 2, 3]; +var array2 = [true, false, "hello"]; +a2([...array]); +a1(...array); +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +a10([1, 2, 3, false, true]); // Parameter type is any[] +a10([1, 2]); // Parameter type is any[] +a11([1, 2]); // Parameter type is number[] +// Rest parameter with generic +function foo(...a) { } +foo("hello", 1, 2); +foo("hello", "world"); +var E; +(function (E) { + E[E["a"] = 0] = "a"; + E[E["b"] = 1] = "b"; +})(E || (E = {})); +function foo1(...a) { } +foo1(1, 2, 3, E.a); +foo1(1, 2, 3, 0 /* E1.a */, E.b); diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..4cec32eff4f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).symbols @@ -0,0 +1,146 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// + +=== destructuringParameterDeclaration3ES5iterable.ts === +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5iterable.ts, 0, 0)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) + +type someArray = Array | number[]; +>someArray : Symbol(someArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 6, 32)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) + +type stringOrNumArray = Array; +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 7, 42)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + +function a1(...x: (number|string)[]) { } +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 8, 45)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 12)) + +function a2(...a) { } +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 40)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 11, 12)) + +function a3(...a: Array) { } +>a3 : Symbol(a3, Decl(destructuringParameterDeclaration3ES5iterable.ts, 11, 21)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 12, 12)) +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>String : Symbol(String, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --) ... and 1 more) + +function a4(...a: arrayString) { } +>a4 : Symbol(a4, Decl(destructuringParameterDeclaration3ES5iterable.ts, 12, 36)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 13, 12)) +>arrayString : Symbol(arrayString, Decl(destructuringParameterDeclaration3ES5iterable.ts, 0, 0)) + +function a5(...a: stringOrNumArray) { } +>a5 : Symbol(a5, Decl(destructuringParameterDeclaration3ES5iterable.ts, 13, 34)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 12)) +>stringOrNumArray : Symbol(stringOrNumArray, Decl(destructuringParameterDeclaration3ES5iterable.ts, 7, 42)) + +function a9([a, b, [[c]]]) { } +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 39)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 13)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 15)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 21)) + +function a10([a, b, [[c]], ...x]) { } +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 22)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 26)) + +function a11([a, b, c, ...x]: number[]) { } +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 37)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 14)) +>b : Symbol(b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 16)) +>c : Symbol(c, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 19)) +>x : Symbol(x, Decl(destructuringParameterDeclaration3ES5iterable.ts, 17, 22)) + + +var array = [1, 2, 3]; +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) + +var array2 = [true, false, "hello"]; +>array2 : Symbol(array2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 21, 3)) + +a2([...array]); +>a2 : Symbol(a2, Decl(destructuringParameterDeclaration3ES5iterable.ts, 10, 40)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) + +a1(...array); +>a1 : Symbol(a1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 8, 45)) +>array : Symbol(array, Decl(destructuringParameterDeclaration3ES5iterable.ts, 20, 3)) + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9 : Symbol(a9, Decl(destructuringParameterDeclaration3ES5iterable.ts, 14, 39)) + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) + +a10([1, 2]); // Parameter type is any[] +>a10 : Symbol(a10, Decl(destructuringParameterDeclaration3ES5iterable.ts, 15, 30)) + +a11([1, 2]); // Parameter type is number[] +>a11 : Symbol(a11, Decl(destructuringParameterDeclaration3ES5iterable.ts, 16, 37)) + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 13)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 16)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 33, 13)) + +foo("hello", 1, 2); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) + +foo("hello", "world"); +>foo : Symbol(foo, Decl(destructuringParameterDeclaration3ES5iterable.ts, 30, 12)) + +enum E { a, b } +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) + +const enum E1 { a, b } +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) +>b : Symbol(E1.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 18)) + +function foo1(...a: T[]) { } +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 14)) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>a : Symbol(a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 32)) +>T : Symbol(T, Decl(destructuringParameterDeclaration3ES5iterable.ts, 39, 14)) + +foo1(1, 2, 3, E.a); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) +>E.a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) +>a : Symbol(E.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 8)) + +foo1(1, 2, 3, E1.a, E.b); +>foo1 : Symbol(foo1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 22)) +>E1.a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) +>E1 : Symbol(E1, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 15)) +>a : Symbol(E1.a, Decl(destructuringParameterDeclaration3ES5iterable.ts, 38, 15)) +>E.b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) +>E : Symbol(E, Decl(destructuringParameterDeclaration3ES5iterable.ts, 35, 22)) +>b : Symbol(E.b, Decl(destructuringParameterDeclaration3ES5iterable.ts, 37, 11)) + + + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types new file mode 100644 index 00000000000..c1123928f62 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types @@ -0,0 +1,191 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration3ES5iterable.ts] //// + +=== destructuringParameterDeclaration3ES5iterable.ts === +// If the parameter is a rest parameter, the parameter type is any[] +// A type annotation for a rest parameter must denote an array type. + +// RestParameter: +// ... Identifier TypeAnnotation(opt) + +type arrayString = Array +>arrayString : arrayString + +type someArray = Array | number[]; +>someArray : someArray + +type stringOrNumArray = Array; +>stringOrNumArray : stringOrNumArray + +function a1(...x: (number|string)[]) { } +>a1 : (...x: (string | number)[]) => void +>x : (string | number)[] + +function a2(...a) { } +>a2 : (...a: any[]) => void +>a : any[] + +function a3(...a: Array) { } +>a3 : (...a: String[]) => void +>a : String[] + +function a4(...a: arrayString) { } +>a4 : (...a: arrayString) => void +>a : arrayString + +function a5(...a: stringOrNumArray) { } +>a5 : (...a: stringOrNumArray) => void +>a : stringOrNumArray + +function a9([a, b, [[c]]]) { } +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>a : any +>b : any +>c : any + +function a10([a, b, [[c]], ...x]) { } +>a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void +>a : any +>b : any +>c : any +>x : any[] + +function a11([a, b, c, ...x]: number[]) { } +>a11 : ([a, b, c, ...x]: number[]) => void +>a : number +>b : number +>c : number +>x : number[] + + +var array = [1, 2, 3]; +>array : number[] +>[1, 2, 3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + +var array2 = [true, false, "hello"]; +>array2 : (string | boolean)[] +>[true, false, "hello"] : (string | boolean)[] +>true : true +>false : false +>"hello" : "hello" + +a2([...array]); +>a2([...array]) : void +>a2 : (...a: any[]) => void +>[...array] : number[] +>...array : number +>array : number[] + +a1(...array); +>a1(...array) : void +>a1 : (...x: (string | number)[]) => void +>...array : number +>array : number[] + +a9([1, 2, [["string"]], false, true]); // Parameter type is [any, any, [[any]]] +>a9([1, 2, [["string"]], false, true]) : void +>a9 : ([a, b, [[c]]]: [any, any, [[any]]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : 1 +>2 : 2 +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : "string" +>false : false +>true : true + +a10([1, 2, [["string"]], false, true]); // Parameter type is any[] +>a10([1, 2, [["string"]], false, true]) : void +>a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void +>[1, 2, [["string"]], false, true] : [number, number, [[string]], boolean, boolean] +>1 : 1 +>2 : 2 +>[["string"]] : [[string]] +>["string"] : [string] +>"string" : "string" +>false : false +>true : true + +a10([1, 2, 3, false, true]); // Parameter type is any[] +>a10([1, 2, 3, false, true]) : void +>a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void +>[1, 2, 3, false, true] : [number, number, number, boolean, boolean] +>1 : 1 +>2 : 2 +>3 : 3 +>false : false +>true : true + +a10([1, 2]); // Parameter type is any[] +>a10([1, 2]) : void +>a10 : ([a, b, [[c]], ...x]: [any, any, [[any]], ...any[]]) => void +>[1, 2] : [number, number] +>1 : 1 +>2 : 2 + +a11([1, 2]); // Parameter type is number[] +>a11([1, 2]) : void +>a11 : ([a, b, c, ...x]: number[]) => void +>[1, 2] : number[] +>1 : 1 +>2 : 2 + +// Rest parameter with generic +function foo(...a: T[]) { } +>foo : (...a: T[]) => void +>a : T[] + +foo("hello", 1, 2); +>foo("hello", 1, 2) : void +>foo : (...a: T[]) => void +>"hello" : "hello" +>1 : 1 +>2 : 2 + +foo("hello", "world"); +>foo("hello", "world") : void +>foo : (...a: T[]) => void +>"hello" : "hello" +>"world" : "world" + +enum E { a, b } +>E : E +>a : E.a +>b : E.b + +const enum E1 { a, b } +>E1 : E1 +>a : E1.a +>b : E1.b + +function foo1(...a: T[]) { } +>foo1 : (...a: T[]) => void +>a : T[] + +foo1(1, 2, 3, E.a); +>foo1(1, 2, 3, E.a) : void +>foo1 : (...a: T[]) => void +>1 : 1 +>2 : 2 +>3 : 3 +>E.a : E.a +>E : typeof E +>a : E.a + +foo1(1, 2, 3, E1.a, E.b); +>foo1(1, 2, 3, E1.a, E.b) : void +>foo1 : (...a: T[]) => void +>1 : 1 +>2 : 2 +>3 : 3 +>E1.a : E1.a +>E1 : typeof E1 +>a : E1.a +>E.b : E.b +>E : typeof E +>b : E.b + + + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff new file mode 100644 index 00000000000..61ca2c5ec0a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration3ES5iterable(target=es2015).types.diff @@ -0,0 +1,28 @@ +--- old.destructuringParameterDeclaration3ES5iterable(target=es2015).types ++++ new.destructuringParameterDeclaration3ES5iterable(target=es2015).types +@@= skipped -16, +16 lines =@@ + >stringOrNumArray : stringOrNumArray + + function a1(...x: (number|string)[]) { } +->a1 : (...x: (number | string)[]) => void ++>a1 : (...x: (string | number)[]) => void + >x : (string | number)[] + + function a2(...a) { } +@@= skipped -8, +8 lines =@@ + >a : any[] + + function a3(...a: Array) { } +->a3 : (...a: Array) => void ++>a3 : (...a: String[]) => void + >a : String[] + + function a4(...a: arrayString) { } +@@= skipped -55, +55 lines =@@ + + a1(...array); + >a1(...array) : void +->a1 : (...x: (number | string)[]) => void ++>a1 : (...x: (string | number)[]) => void + >...array : number + >array : number[] 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 new file mode 100644 index 00000000000..5f35e586c3d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.destructuringParameterDeclaration7ES5iterable(target=es2015).errors.txt ++++ new.destructuringParameterDeclaration7ES5iterable(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 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. ++ ++ ++!!! 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/destructuringParameterDeclaration7ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js new file mode 100644 index 00000000000..3f0c319f5b0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).js @@ -0,0 +1,23 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// + +//// [destructuringParameterDeclaration7ES5iterable.ts] +interface ISomething { + foo: string, + bar: string +} + +function foo({}, {foo, bar}: ISomething) {} + +function baz([], {foo, bar}: ISomething) {} + +function one([], {}) {} + +function two([], [a, b, c]: number[]) {} + + +//// [destructuringParameterDeclaration7ES5iterable.js] +"use strict"; +function foo({}, { foo, bar }) { } +function baz([], { foo, bar }) { } +function one([], {}) { } +function two([], [a, b, c]) { } diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..6662a963079 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).symbols @@ -0,0 +1,34 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// + +=== destructuringParameterDeclaration7ES5iterable.ts === +interface ISomething { +>ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) + + foo: string, +>foo : Symbol(ISomething.foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 22)) + + bar: string +>bar : Symbol(ISomething.bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 1, 16)) +} + +function foo({}, {foo, bar}: ISomething) {} +>foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 3, 1)) +>foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 18)) +>bar : Symbol(bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 22)) +>ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) + +function baz([], {foo, bar}: ISomething) {} +>baz : Symbol(baz, Decl(destructuringParameterDeclaration7ES5iterable.ts, 5, 43)) +>foo : Symbol(foo, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 18)) +>bar : Symbol(bar, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 22)) +>ISomething : Symbol(ISomething, Decl(destructuringParameterDeclaration7ES5iterable.ts, 0, 0)) + +function one([], {}) {} +>one : Symbol(one, Decl(destructuringParameterDeclaration7ES5iterable.ts, 7, 43)) + +function two([], [a, b, c]: number[]) {} +>two : Symbol(two, Decl(destructuringParameterDeclaration7ES5iterable.ts, 9, 23)) +>a : Symbol(a, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 18)) +>b : Symbol(b, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 20)) +>c : Symbol(c, Decl(destructuringParameterDeclaration7ES5iterable.ts, 11, 23)) + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types new file mode 100644 index 00000000000..917fdc4d2b6 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringParameterDeclaration7ES5iterable(target=es2015).types @@ -0,0 +1,30 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration7ES5iterable.ts] //// + +=== destructuringParameterDeclaration7ES5iterable.ts === +interface ISomething { + foo: string, +>foo : string + + bar: string +>bar : string +} + +function foo({}, {foo, bar}: ISomething) {} +>foo : ({}: {}, { foo, bar }: ISomething) => void +>foo : string +>bar : string + +function baz([], {foo, bar}: ISomething) {} +>baz : ([]: Iterable, { foo, bar }: ISomething) => void +>foo : string +>bar : string + +function one([], {}) {} +>one : ([]: Iterable, {}: {}) => void + +function two([], [a, b, c]: number[]) {} +>two : ([]: Iterable, [a, b, c]: number[]) => void +>a : number +>b : number +>c : number + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt new file mode 100644 index 00000000000..e04ff261042 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt @@ -0,0 +1,52 @@ +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. + 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] } }; + ~~~~~~~~~ +!!! error TS2322: Type 'undefined' is not assignable to type 'number'. + ~~~~ +!!! error TS2322: Type 'null' is not assignable to type 'number'. + + \ No newline at end of file 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 new file mode 100644 index 00000000000..421d5e05f33 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.destructuringVariableDeclaration1ES5iterable(target=es2015).errors.txt ++++ 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/destructuringVariableDeclaration1ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js new file mode 100644 index 00000000000..dd54c33fc91 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).js @@ -0,0 +1,80 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// + +//// [destructuringVariableDeclaration1ES5iterable.ts] +// 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] } }; + + + +//// [destructuringVariableDeclaration1ES5iterable.js] +"use strict"; +// 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: 10, a2: "world" }; +var [a3, [[a4]], a5] = [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: [1, 2] } }; +var { h: { h1 = [undefined, null] } } = { h: { h1: [1, 2] } }; diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..8ee0b316cd0 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).symbols @@ -0,0 +1,122 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// + +=== destructuringVariableDeclaration1ES5iterable.ts === +// 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" } +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 5)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 8)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 15)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 27)) +>a1 : Symbol(a1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 44)) +>a2 : Symbol(a2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 2, 52)) + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : Symbol(a3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 5)) +>a4 : Symbol(a4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 11)) +>a5 : Symbol(a5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 3, 16)) + +// 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" } }; +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 44)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 11)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 21)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 44)) +>b11 : Symbol(b11, Decl(destructuringVariableDeclaration1ES5iterable.ts, 7, 50)) + +var temp = { t1: true, t2: "false" }; +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 12)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 22)) + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : Symbol(b2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 5)) +>b3 : Symbol(b3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 12)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) +>t1 : Symbol(t1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 49)) +>t2 : Symbol(t2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 9, 60)) + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : Symbol(b5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 5)) +>b6 : Symbol(b6, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 12)) +>b7 : Symbol(b7, Decl(destructuringVariableDeclaration1ES5iterable.ts, 10, 23)) +>temp : Symbol(temp, Decl(destructuringVariableDeclaration1ES5iterable.ts, 8, 3)) +>undefined : Symbol(undefined) +>undefined : Symbol(undefined) +>undefined : Symbol(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]; +>c1 : Symbol(c1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 15, 5)) + +var [...c2] = [1,2,3, "string"]; +>c2 : Symbol(c2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 16, 5)) + +// 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"] +>d1 : Symbol(d1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 22, 5)) +>d2 : Symbol(d2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 22, 8)) + +// 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] +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 27, 3)) + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : Symbol(d3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 28, 5)) +>d4 : Symbol(d4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 28, 8)) +>temp1 : Symbol(temp1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 27, 3)) + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e : Symbol(e, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 49)) +>e1 : Symbol(e1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 9)) +>e2 : Symbol(e2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 12)) +>e3 : Symbol(e3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 16)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 23)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 33)) +>e : Symbol(e, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 49)) +>b1 : Symbol(b1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 61)) +>b4 : Symbol(b4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 31, 68)) + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f : Symbol(f, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 41)) +>f1 : Symbol(f1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 9)) +>f2 : Symbol(f2, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 12)) +>f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 53)) +>f4 : Symbol(f4, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 18)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 26)) +>f : Symbol(f, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 41)) +>f3 : Symbol(f3, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 53)) +>f5 : Symbol(f5, Decl(destructuringVariableDeclaration1ES5iterable.ts, 32, 60)) + +// 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] } }; +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 36)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 9)) +>undefined : Symbol(undefined) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 36)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 41)) +>g : Symbol(g, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 59)) +>g1 : Symbol(g1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 37, 64)) + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 36)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 9)) +>undefined : Symbol(undefined) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 36)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 41)) +>h : Symbol(h, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 62)) +>h1 : Symbol(h1, Decl(destructuringVariableDeclaration1ES5iterable.ts, 38, 67)) + + diff --git a/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types new file mode 100644 index 00000000000..ca71624b138 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/destructuringVariableDeclaration1ES5iterable(target=es2015).types @@ -0,0 +1,199 @@ +//// [tests/cases/conformance/es6/destructuring/destructuringVariableDeclaration1ES5iterable.ts] //// + +=== destructuringVariableDeclaration1ES5iterable.ts === +// 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" } +>a1 : number +>a2 : string +>a1 : number +>a2 : string +>{ a1: 10, a2: "world" } : { a1: number; a2: string; } +>a1 : number +>10 : 10 +>a2 : string +>"world" : "world" + +var [a3, [[a4]], a5]: [number, [[string]], boolean] = [1, [["hello"]], true]; +>a3 : number +>a4 : string +>a5 : boolean +>[1, [["hello"]], true] : [number, [[string]], true] +>1 : 1 +>[["hello"]] : [[string]] +>["hello"] : [string] +>"hello" : "hello" +>true : 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" } }; +>b1 : any +>b11 : string +>{ b11: "string" } : { b11: string; } +>b11 : string +>"string" : "string" +>{ b1: { b11: "world" } } : { b1?: { b11: string; }; } +>b1 : { b11: string; } +>{ b11: "world" } : { b11: string; } +>b11 : string +>"world" : "world" + +var temp = { t1: true, t2: "false" }; +>temp : { t1: boolean; t2: string; } +>{ t1: true, t2: "false" } : { t1: boolean; t2: string; } +>t1 : boolean +>true : true +>t2 : string +>"false" : "false" + +var [b2 = 3, b3 = true, b4 = temp] = [3, false, { t1: false, t2: "hello" }]; +>b2 : number +>3 : 3 +>b3 : boolean +>true : true +>b4 : { t1: boolean; t2: string; } +>temp : { t1: boolean; t2: string; } +>[3, false, { t1: false, t2: "hello" }] : [number, false, { t1: false; t2: string; }] +>3 : 3 +>false : false +>{ t1: false, t2: "hello" } : { t1: false; t2: string; } +>t1 : false +>false : false +>t2 : string +>"hello" : "hello" + +var [b5 = 3, b6 = true, b7 = temp] = [undefined, undefined, undefined]; +>b5 : number +>3 : 3 +>b6 : boolean +>true : true +>b7 : { t1: boolean; t2: string; } +>temp : { t1: boolean; t2: string; } +>[undefined, undefined, undefined] : [undefined, undefined, undefined] +>undefined : undefined +>undefined : 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]; +>c1 : number[] +>[1,2,3] : number[] +>1 : 1 +>2 : 2 +>3 : 3 + +var [...c2] = [1,2,3, "string"]; +>c2 : (string | number)[] +>[1,2,3, "string"] : (string | number)[] +>1 : 1 +>2 : 2 +>3 : 3 +>"string" : "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"] +>d1 : number +>d2 : string +>[1,"string"] : [number, string] +>1 : 1 +>"string" : "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] +>temp1 : boolean[] +>[true, false, true] : boolean[] +>true : true +>false : false +>true : true + +var [d3, d4] = [1, "string", ...temp1]; +>d3 : number +>d4 : string +>[1, "string", ...temp1] : [number, string, ...boolean[]] +>1 : 1 +>"string" : "string" +>...temp1 : boolean +>temp1 : boolean[] + +// Combining both forms of destructuring, +var {e: [e1, e2, e3 = { b1: 1000, b4: 200 }]} = { e: [1, 2, { b1: 4, b4: 0 }] }; +>e : any +>e1 : number +>e2 : number +>e3 : { b1: number; b4: number; } +>{ b1: 1000, b4: 200 } : { b1: number; b4: number; } +>b1 : number +>1000 : 1000 +>b4 : number +>200 : 200 +>{ e: [1, 2, { b1: 4, b4: 0 }] } : { e: [number, number, { b1: number; b4: number; }]; } +>e : [number, number, { b1: number; b4: number; }] +>[1, 2, { b1: 4, b4: 0 }] : [number, number, { b1: number; b4: number; }] +>1 : 1 +>2 : 2 +>{ b1: 4, b4: 0 } : { b1: number; b4: number; } +>b1 : number +>4 : 4 +>b4 : number +>0 : 0 + +var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; +>f : any +>f1 : number +>f2 : number +>f3 : any +>f4 : number +>f5 : number +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] +>1 : 1 +>2 : 2 +>{ f3: 4, f5: 0 } : { f3: number; f5: number; } +>f3 : number +>4 : 4 +>f5 : number +>0 : 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] } }; +>g : any +>g1 : any[] +>[undefined, null] : (null | undefined)[] +>undefined : undefined +>g : { g1: any[]; } +>g1 : any[] +>{ g: { g1: [1, 2] } } : { g: { g1: number[]; }; } +>g : { g1: number[]; } +>{ g1: [1, 2] } : { g1: number[]; } +>g1 : number[] +>[1, 2] : number[] +>1 : 1 +>2 : 2 + +var {h: {h1 = [undefined, null]}}: { h: { h1: number[] } } = { h: { h1: [1, 2] } }; +>h : any +>h1 : number[] +>[undefined, null] : (null | undefined)[] +>undefined : undefined +>h : { h1: number[]; } +>h1 : number[] +>{ h: { h1: [1, 2] } } : { h: { h1: number[]; }; } +>h : { h1: number[]; } +>{ h1: [1, 2] } : { h1: number[]; } +>h1 : number[] +>[1, 2] : number[] +>1 : 1 +>2 : 2 + + 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 new file mode 100644 index 00000000000..55040842698 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.emptyAssignmentPatterns01_ES5iterable(target=es2015).errors.txt ++++ new.emptyAssignmentPatterns01_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 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. ++ ++ ++!!! 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/emptyAssignmentPatterns01_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..10613e7a7dd --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).js @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// + +//// [emptyAssignmentPatterns01_ES5iterable.ts] +var a: any; + +({} = a); +([] = a); + +//// [emptyAssignmentPatterns01_ES5iterable.js] +"use strict"; +var a; +({} = a); +([] = a); + + +//// [emptyAssignmentPatterns01_ES5iterable.d.ts] +declare var a: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..5d488a00564 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).symbols @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// + +=== emptyAssignmentPatterns01_ES5iterable.ts === +var a: any; +>a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) + +({} = a); +>a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) + +([] = a); +>a : Symbol(a, Decl(emptyAssignmentPatterns01_ES5iterable.ts, 0, 3)) + diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..e8994133651 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns01_ES5iterable(target=es2015).types @@ -0,0 +1,18 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns01_ES5iterable.ts] //// + +=== 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/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 new file mode 100644 index 00000000000..38909801779 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.emptyAssignmentPatterns02_ES5iterable(target=es2015).errors.txt ++++ new.emptyAssignmentPatterns02_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 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. ++ ++ ++!!! 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/emptyAssignmentPatterns02_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..c182ccd2964 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).js @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// + +//// [emptyAssignmentPatterns02_ES5iterable.ts] +var a: any; +let x, y, z, a1, a2, a3; + +({} = { x, y, z } = a); +([] = [ a1, a2, a3] = a); + +//// [emptyAssignmentPatterns02_ES5iterable.js] +"use strict"; +var a; +let x, y, z, a1, a2, a3; +({} = { x, y, z } = a); +([] = [a1, a2, a3] = a); + + +//// [emptyAssignmentPatterns02_ES5iterable.d.ts] +declare var a: any; +declare let x: any, y: any, z: any, a1: any, a2: any, a3: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..d73c429d809 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// + +=== emptyAssignmentPatterns02_ES5iterable.ts === +var a: any; +>a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) + +let x, y, z, a1, a2, a3; +>x : Symbol(x, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 3)) +>y : Symbol(y, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 6)) +>z : Symbol(z, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 9)) +>a1 : Symbol(a1, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 12)) +>a2 : Symbol(a2, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 16)) +>a3 : Symbol(a3, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 20)) + +({} = { x, y, z } = a); +>x : Symbol(x, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 7)) +>y : Symbol(y, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 10)) +>z : Symbol(z, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 3, 13)) +>a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) + +([] = [ a1, a2, a3] = a); +>a1 : Symbol(a1, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 12)) +>a2 : Symbol(a2, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 16)) +>a3 : Symbol(a3, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 1, 20)) +>a : Symbol(a, Decl(emptyAssignmentPatterns02_ES5iterable.ts, 0, 3)) + diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..5fa735a25ab --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns02_ES5iterable(target=es2015).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns02_ES5iterable.ts] //// + +=== 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/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 new file mode 100644 index 00000000000..7477b9e1601 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.emptyAssignmentPatterns03_ES5iterable(target=es2015).errors.txt ++++ new.emptyAssignmentPatterns03_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 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. ++ ++ ++!!! 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/emptyAssignmentPatterns03_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..f6df328e83b --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).js @@ -0,0 +1,17 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// + +//// [emptyAssignmentPatterns03_ES5iterable.ts] +var a: any; + +({} = {} = a); +([] = [] = a); + +//// [emptyAssignmentPatterns03_ES5iterable.js] +"use strict"; +var a; +({} = {} = a); +([] = [] = a); + + +//// [emptyAssignmentPatterns03_ES5iterable.d.ts] +declare var a: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..83d02d139fc --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).symbols @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// + +=== emptyAssignmentPatterns03_ES5iterable.ts === +var a: any; +>a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) + +({} = {} = a); +>a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) + +([] = [] = a); +>a : Symbol(a, Decl(emptyAssignmentPatterns03_ES5iterable.ts, 0, 3)) + diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..5412c533246 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns03_ES5iterable(target=es2015).types @@ -0,0 +1,22 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns03_ES5iterable.ts] //// + +=== 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/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 new file mode 100644 index 00000000000..43ef9aa6575 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.emptyAssignmentPatterns04_ES5iterable(target=es2015).errors.txt ++++ new.emptyAssignmentPatterns04_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 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. ++ ++ ++!!! 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/emptyAssignmentPatterns04_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..35b6abb4652 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).js @@ -0,0 +1,20 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// + +//// [emptyAssignmentPatterns04_ES5iterable.ts] +var a: any; +let x, y, z, a1, a2, a3; + +({ x, y, z } = {} = a); +([ a1, a2, a3] = [] = a); + +//// [emptyAssignmentPatterns04_ES5iterable.js] +"use strict"; +var a; +let x, y, z, a1, a2, a3; +({ x, y, z } = {} = a); +([a1, a2, a3] = [] = a); + + +//// [emptyAssignmentPatterns04_ES5iterable.d.ts] +declare var a: any; +declare let x: any, y: any, z: any, a1: any, a2: any, a3: any; diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..696162e321a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).symbols @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// + +=== emptyAssignmentPatterns04_ES5iterable.ts === +var a: any; +>a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) + +let x, y, z, a1, a2, a3; +>x : Symbol(x, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 3)) +>y : Symbol(y, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 6)) +>z : Symbol(z, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 9)) +>a1 : Symbol(a1, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 12)) +>a2 : Symbol(a2, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 16)) +>a3 : Symbol(a3, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 20)) + +({ x, y, z } = {} = a); +>x : Symbol(x, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 2)) +>y : Symbol(y, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 5)) +>z : Symbol(z, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 3, 8)) +>a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) + +([ a1, a2, a3] = [] = a); +>a1 : Symbol(a1, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 12)) +>a2 : Symbol(a2, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 16)) +>a3 : Symbol(a3, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 1, 20)) +>a : Symbol(a, Decl(emptyAssignmentPatterns04_ES5iterable.ts, 0, 3)) + diff --git a/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..8673a737d38 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyAssignmentPatterns04_ES5iterable(target=es2015).types @@ -0,0 +1,36 @@ +//// [tests/cases/conformance/es6/destructuring/emptyAssignmentPatterns04_ES5iterable.ts] //// + +=== 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/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 new file mode 100644 index 00000000000..96b4df48117 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).errors.txt ++++ new.emptyVariableDeclarationBindingPatterns01_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 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. ++ ++ ++!!! 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/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..64cdc1b4f95 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).js @@ -0,0 +1,89 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// + +//// [emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] +(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) { + } +})(); + +//// [emptyVariableDeclarationBindingPatterns01_ES5iterable.js] +"use strict"; +(function () { + var a; + 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 = []; + for (var {} of ns) { + } + for (let {} of ns) { + } + for (const {} of ns) { + } + for (var [] of ns) { + } + for (let [] of ns) { + } + for (const [] of ns) { + } +})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..99ed4d5911f --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).symbols @@ -0,0 +1,93 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// + +=== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts === +(function () { + var a: any; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + var {} = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + let {} = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + const {} = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + var [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + let [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + const [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + var {} = a, [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + let {} = a, [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + const {} = a, [] = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + var { p1: {}, p2: [] } = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + let { p1: {}, p2: [] } = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + const { p1: {}, p2: [] } = a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + for (var {} = {}, {} = {}; false; void 0) { + } + + function f({} = a, [] = a, { p: {} = a} = a) { +>f : Symbol(f, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 20, 5)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + + return ({} = a, [] = a, { p: {} = a } = a) => a; +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) +>a : Symbol(a, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 1, 7)) + } +})(); + +(function () { + const ns: number[][] = []; +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + + for (var {} of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } + + for (let {} of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } + + for (const {} of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } + + for (var [] of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } + + for (let [] of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } + + for (const [] of ns) { +>ns : Symbol(ns, Decl(emptyVariableDeclarationBindingPatterns01_ES5iterable.ts, 28, 9)) + } +})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..a80899f2567 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns01_ES5iterable(target=es2015).types @@ -0,0 +1,116 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5iterable.ts] //// + +=== emptyVariableDeclarationBindingPatterns01_ES5iterable.ts === +(function () { +>(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; }})() : void +>(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; }}) : () => void +>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; }} : () => void + + 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 +>p2 : any +>a : any + + let { p1: {}, p2: [] } = a; +>p1 : any +>p2 : any +>a : any + + const { p1: {}, p2: [] } = a; +>p1 : any +>p2 : any +>a : any + + for (var {} = {}, {} = {}; false; void 0) { +>{} : {} +>{} : {} +>false : false +>void 0 : undefined +>0 : 0 + } + + function f({} = a, [] = a, { p: {} = a} = a) { +>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 + } +})(); + +(function () { +>(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) { }})() : void +>(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) { }}) : () => void +>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) { }} : () => void + + const ns: number[][] = []; +>ns : number[][] +>[] : never[] + + for (var {} of ns) { +>ns : number[][] + } + + for (let {} of ns) { +>ns : number[][] + } + + for (const {} of ns) { +>ns : number[][] + } + + for (var [] of ns) { +>ns : number[][] + } + + for (let [] of ns) { +>ns : number[][] + } + + for (const [] of ns) { +>ns : number[][] + } +})(); 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 new file mode 100644 index 00000000000..59321851b22 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt @@ -0,0 +1,32 @@ +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. +emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(6,9): error TS1182: A destructuring declaration must have an initializer. +emptyVariableDeclarationBindingPatterns02_ES5iterable.ts(7,9): error TS1182: A destructuring declaration must have an initializer. +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 {}; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + let {}; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + const {}; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + + var []; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + let []; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + const []; + ~~ +!!! error TS1182: A destructuring declaration must have an initializer. + })(); \ No newline at end of file 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 new file mode 100644 index 00000000000..18e03a0e413 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt.diff @@ -0,0 +1,17 @@ +--- old.emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).errors.txt ++++ 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, +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/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js new file mode 100644 index 00000000000..25681850f93 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).js @@ -0,0 +1,26 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// + +//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] +(function () { + var {}; + let {}; + const {}; + + var []; + let []; + const []; +})(); + +//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.js] +"use strict"; +(function () { + var {}; + let {}; + const {}; + var []; + let []; + const []; +})(); + + +//// [emptyVariableDeclarationBindingPatterns02_ES5iterable.d.ts] diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols new file mode 100644 index 00000000000..0cc47dcfaa7 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).symbols @@ -0,0 +1,13 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// + +=== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts === + +(function () { + var {}; + let {}; + const {}; + + var []; + let []; + const []; +})(); diff --git a/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types new file mode 100644 index 00000000000..88cd703f8a9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/emptyVariableDeclarationBindingPatterns02_ES5iterable(target=es2015).types @@ -0,0 +1,16 @@ +//// [tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5iterable.ts] //// + +=== emptyVariableDeclarationBindingPatterns02_ES5iterable.ts === +(function () { +>(function () { var {}; let {}; const {}; var []; let []; const [];})() : void +>(function () { var {}; let {}; const {}; var []; let []; const [];}) : () => void +>function () { var {}; let {}; const {}; var []; let []; const [];} : () => void + + var {}; + let {}; + const {}; + + var []; + let []; + const []; +})(); 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 new file mode 100644 index 00000000000..519818c6015 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.forAwaitPerIterationBindingDownlevel(target=es2015).errors.txt ++++ new.forAwaitPerIterationBindingDownlevel(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 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. ++ ++ ++!!! 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/forAwaitPerIterationBindingDownlevel(target=es2015).js b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js new file mode 100644 index 00000000000..c5aa8bdc8d2 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/forAwaitPerIterationBindingDownlevel(target=es2015).js @@ -0,0 +1,96 @@ +//// [tests/cases/conformance/statements/for-await-ofStatements/forAwaitPerIterationBindingDownlevel.ts] //// + +//// [forAwaitPerIterationBindingDownlevel.ts] +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}`); + } + })(); + } +})(); + +//// [forAwaitPerIterationBindingDownlevel.js] +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; + function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } + function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +var __asyncValues = (this && this.__asyncValues) || function (o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +}; +const sleep = (tm) => new Promise(resolve => setTimeout(resolve, tm)); +function gen() { + return __asyncGenerator(this, arguments, function* gen_1() { + yield yield __await(1); + yield __await(sleep(1000)); + yield yield __await(2); + }); +} +const log = console.log; +(() => __awaiter(void 0, void 0, void 0, function* () { + var _a, e_1, _b, _c; + try { + for (var _d = true, _e = __asyncValues(gen()), _f; _f = yield _e.next(), _a = _f.done, !_a; _d = true) { + _c = _f.value; + _d = false; + const outer = _c; + log(`I'm loop ${outer}`); + (() => __awaiter(void 0, void 0, void 0, function* () { + const inner = outer; + yield 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}`); + } + }))(); + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (!_d && !_a && (_b = _e.return)) yield _b.call(_e); + } + finally { if (e_1) throw e_1.error; } + } +}))(); 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 new file mode 100644 index 00000000000..649f5f6d660 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).errors.txt.diff @@ -0,0 +1,14 @@ +--- old.restParameterInDownlevelGenerator(target=es2015).errors.txt ++++ new.restParameterInDownlevelGenerator(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 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. ++ ++ ++!!! 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 diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js new file mode 100644 index 00000000000..a315f9edd24 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).js @@ -0,0 +1,15 @@ +//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// + +//// [restParameterInDownlevelGenerator.ts] +// https://github.com/Microsoft/TypeScript/issues/30653 +function * mergeStringLists(...strings: string[]) { + for (var str of strings); +} + +//// [restParameterInDownlevelGenerator.js] +"use strict"; +// https://github.com/Microsoft/TypeScript/issues/30653 +function* mergeStringLists(...strings) { + for (var str of strings) + ; +} diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols new file mode 100644 index 00000000000..acc027e7ec4 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).symbols @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// + +=== restParameterInDownlevelGenerator.ts === +// https://github.com/Microsoft/TypeScript/issues/30653 +function * mergeStringLists(...strings: string[]) { +>mergeStringLists : Symbol(mergeStringLists, Decl(restParameterInDownlevelGenerator.ts, 0, 0)) +>strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28)) + + for (var str of strings); +>str : Symbol(str, Decl(restParameterInDownlevelGenerator.ts, 2, 12)) +>strings : Symbol(strings, Decl(restParameterInDownlevelGenerator.ts, 1, 28)) +} diff --git a/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types new file mode 100644 index 00000000000..aeaee13ca2a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/restParameterInDownlevelGenerator(target=es2015).types @@ -0,0 +1,12 @@ +//// [tests/cases/conformance/generators/restParameterInDownlevelGenerator.ts] //// + +=== restParameterInDownlevelGenerator.ts === +// https://github.com/Microsoft/TypeScript/issues/30653 +function * mergeStringLists(...strings: string[]) { +>mergeStringLists : (...strings: string[]) => Generator +>strings : string[] + + for (var str of strings); +>str : string +>strings : string[] +}