Skip to content

Fix flaky diagnostic added by declaration emit through MarkLinkedReferencesRecursively - #64482

Merged
Wesley Wigham (weswigham) merged 2 commits into
microsoft:mainfrom
Andarist:fix-named-function-expression-flaky-2448
Sep 30, 2026
Merged

Wesley Wigham (weswigham) merged 2 commits into
microsoft:mainfrom
Andarist:fix-named-function-expression-flaky-2448

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

fixes a crash reported here: #64458 (comment)

Copilot AI balanced review requested due to automatic review settings September 27, 2026 16:58
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Sep 27, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 27, 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.

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.

Copilot review overview

🟢 Approval recommended

The targeted guard correctly prevents declaration names from being resolved as references, with focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents emit-time resolution of function/class expression declaration names from introducing flaky diagnostics.

Changes:

  • Excludes declaration names from linked-reference resolution.
  • Adds regression coverage and generated emit/type/symbol baselines.
File Description
tsc/​internal/​checker/​checker.go Skips declaration names during expression-reference marking.
tsc/​testdata/​tests/​cases/​compiler/​noFlakyDiagnosticsExpressionNameShadowedInBody1.ts Covers shadowed function and class expression names.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsExpressionNameShadowedInBody1.js Records JavaScript emit.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsExpressionNameShadowedInBody1.symbols Records symbol resolution.
tsc/​testdata/​baselines/​reference/​compiler/​noFlakyDiagnosticsExpressionNameShadowedInBody1.types Records inferred types.

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

@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Sep 30, 2026
Merged via the queue into microsoft:main with commit 81d3f3f Sep 30, 2026
29 checks passed
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