Skip to content

Handle tuple rest parameters in legacy decorator arity checks - #64164

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
Andarist:fix/legacy-decorator-tuple-rest-arity
Sep 4, 2026
Merged

Handle tuple rest parameters in legacy decorator arity checks#64164
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
Andarist:fix/legacy-decorator-tuple-rest-arity

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

At the moment, the test sample reports:

main.ts(6,3): error TS1241: Unable to resolve signature of method decorator when called as an expression.
  The runtime will invoke the decorator with 2 arguments, but the decorator expects 3.

That is not correct here.

This PR relates to a closed issue that reported a crash (see here), Corsa no longer crashes but I noticed now it doesn't quite report correct errors here so I decided to put out this PR for it

Copilot AI balanced review requested due to automatic review settings September 4, 2026 07:02
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 4, 2026
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 4, 2026
@typescript-automation

Copy link
Copy Markdown

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The fix and regression baselines were fully reviewed with no unresolved issues.

Pull request overview

Corrects legacy decorator arity checks for tuple-typed rest parameters.

Changes:

  • Uses effective parameter counts for decorator arity checks.
  • Adds regression coverage and expected baselines.
File summaries
File Description
tsc/testdata/tests/cases/compiler/decoratorRestNoCrash1.ts Adds regression coverage.
tsc/testdata/baselines/reference/compiler/decoratorRestNoCrash1.types Records inferred types.
tsc/testdata/baselines/reference/compiler/decoratorRestNoCrash1.symbols Records resolved symbols.
tsc/testdata/baselines/reference/compiler/decoratorRestNoCrash1.errors.txt Confirms expected diagnostics.
tsc/internal/checker/checker.go Corrects decorator arity calculation.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Sep 4, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Sep 4, 2026
Merged via the queue into microsoft:main with commit e6e89f9 Sep 4, 2026
26 checks passed
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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