Skip to content

Report implicit any errors in function type binding patterns during checking - #64856

Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:andarist/function-type-binding-pattern-flake
Open

Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:andarist/function-type-binding-pattern-flake

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes flake reported here: #64849 (comment)

Copilot AI balanced review requested due to automatic review settings October 18, 2026 09:59
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Oct 18, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 18, 2026
@typescript-automation

Copy link
Copy Markdown
Contributor

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

c.renamedBindingElementsInTypes = append(c.renamedBindingElementsInTypes, node)
// Still resolve the type like the end of this function does for every other declaration,
// so implicit any errors are reported by checking instead of by whatever asks for the type later
c.getTypeOfSymbol(c.getSymbolOfDeclaration(node))

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is a similar fix to #64646

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

there are some new errors here - but just because this test uses noEmit: true. So this lies in the same area as the fixed flake really, the emit variant of this test would already show those errors

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 localized fix follows existing type-resolution behavior, includes regression coverage, and has no identified blocking issues.

No open issues 🎉

What changed in this PR

Stabilizes implicit-any diagnostics for function-type binding patterns by resolving their types during checking, addressing the flake linked in #64849.

Changes:

  • Resolves renamed binding elements before the checker returns early.
  • Adds TypeScript and JavaScript/JSDoc regression tests with baselines.
  • Updates syntax-error baselines for the additional diagnostics.
File Description
tsc/​testdata/​tests/​cases/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType2.ts Adds JavaScript/JSDoc regression coverage.
tsc/​testdata/​tests/​cases/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType1.ts Adds TypeScript regression coverage.
tsc/​testdata/​baselines/​reference/​compiler/​parametersSyntaxErrorNoCrash3.errors.txt Records additional implicit-any errors.
tsc/​testdata/​baselines/​reference/​compiler/​parametersSyntaxErrorNoCrash2.errors.txt Records additional implicit-any errors.
tsc/​testdata/​baselines/​reference/​compiler/​parametersSyntaxErrorNoCrash1.errors.txt Records an additional implicit-any error.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType2.types Captures JSDoc type results.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType2.symbols Captures JSDoc symbol results.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType2.js Captures JavaScript and declaration output.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType2.errors.txt Captures JSDoc regression diagnostics.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType1.types Captures TypeScript type results.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType1.symbols Captures TypeScript symbol results.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType1.js Captures JavaScript and declaration output.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsBindingPatternInFunctionType1.errors.txt Captures TypeScript regression diagnostics.
tsc/​internal/​checker/​checker.go Resolves binding-element types during checking.

Review effort: Balanced

This branch has not been deployed

No deployments
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: Not started

Development

Successfully merging this pull request may close these issues.

2 participants