Skip to content

Conversation

@jakebailey
Copy link
Member

Found this while working on moving the target up to ES2024. This is illegal code, but we need to not attempt to transform it otherwise it'll break later.

Copilot AI review requested due to automatic review settings January 23, 2026 23:13
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Jan 23, 2026
@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Jan 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a crash in the TypeScript transformer when processing destructured parameter properties with ES2024 target. The code in question is illegal TypeScript (parameter properties cannot use binding patterns), but the compiler should not crash when processing it - it should emit the appropriate error and continue.

Changes:

  • Added a runtime check to skip parameter properties with non-identifier names (destructuring patterns) during class member transformation
  • Added a test case to ensure the fix works with ES2024 target

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/compiler/transformers/ts.ts Added defensive check to skip destructured parameter properties before attempting to create property declarations
tests/cases/compiler/declarationEmitDestructuringParameterProperties2.ts Test case demonstrating the issue with ES2024 target
tests/baselines/reference/declarationEmitDestructuringParameterProperties2.types Baseline showing type inference for the test case
tests/baselines/reference/declarationEmitDestructuringParameterProperties2.symbols Baseline showing symbol resolution for the test case
tests/baselines/reference/declarationEmitDestructuringParameterProperties2.js Baseline showing JS output with ES2024 target (modern class syntax)
tests/baselines/reference/declarationEmitDestructuringParameterProperties2.errors.txt Baseline showing expected TS1187 errors for illegal destructured parameter properties

@jakebailey jakebailey enabled auto-merge January 23, 2026 23:47
@jakebailey jakebailey changed the title Fix declaration emit crash with destructured parameter property Fix transform crash with destructured parameter property Jan 23, 2026
@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Jan 23, 2026
@jakebailey jakebailey added this pull request to the merge queue Jan 23, 2026
Merged via the queue into microsoft:main with commit b19a9da Jan 23, 2026
38 of 39 checks passed
@jakebailey jakebailey deleted the fix-decl-crash branch January 23, 2026 23:58
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants