Skip to content

Suggest the ES2015 library for missing Symbol references - #65473

Open
Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/symbol-lib-diagnostic
Open

Jake Bailey (jakebailey) wants to merge 1 commit into
microsoft:mainfrom
jakebailey:compiler-fixes/symbol-lib-diagnostic

Conversation

@jakebailey

Copy link
Copy Markdown
Member

This is a funny oops. Probably a find and replace.

The missing-library hint matches source identifier text. The spelling
ast.Symbol can never match the global Symbol identifier, so missing
Symbol references fall back to generic name and shorthand errors.

Match Symbol itself so value, shorthand, and type references receive
the existing ES2015 library guidance.
Copilot AI balanced review requested due to automatic review settings November 13, 2026 04:47
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 13, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 13, 2026

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

No active review issues block approval of the Symbol diagnostic fix.

No open issues 🎉

What changed in this PR

Fixes the native TypeScript checker so unresolved Symbol references suggest enabling the ES2015 library or later.

Changes:

  • Corrects the diagnostic lookup from "ast.Symbol" to "Symbol".
  • Adds a regression test covering value, shorthand-property, and type references, with diagnostic, emit, type, and symbol baselines.
File Description
tsc/​testdata/​tests/​cases/​compiler/​missingSymbolLibraryDiagnostic.ts Tests missing Symbol references without built-in libraries.
tsc/​testdata/​baselines/​reference/​compiler/​missingSymbolLibraryDiagnostic.types Records expected type information.
tsc/​testdata/​baselines/​reference/​compiler/​missingSymbolLibraryDiagnostic.symbols Records expected symbol information.
tsc/​testdata/​baselines/​reference/​compiler/​missingSymbolLibraryDiagnostic.js Records expected JavaScript output.
tsc/​testdata/​baselines/​reference/​compiler/​missingSymbolLibraryDiagnostic.errors.txt Captures the ES2015 library suggestion for all three references.
tsc/​internal/​checker/​checker.go Routes unresolved Symbol names to the library-suggestion diagnostic.

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

Author: Team 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