Skip to content

[WIP] Port changes from TypeScript pull request 63200#2930

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/port-typescript-pull-63200
Draft

[WIP] Port changes from TypeScript pull request 63200#2930
Copilot wants to merge 2 commits intomainfrom
copilot/port-typescript-pull-63200

Conversation

Copy link
Contributor

Copilot AI commented Feb 27, 2026

  • Analyze TypeScript PR #63200 (Adds the symbol name to error message for TS2742)
  • Add new TS2883 diagnostic: "The inferred type of '{0}' cannot be named without a reference to '{2}' from '{1}'..."
  • Keep TS2742 diagnostic unchanged (used when symbolName is empty)
  • Update SymbolTracker interface: add symbolName string parameter to ReportLikelyUnsafeImportRequiredError
  • Update SymbolTrackerImpl in checker/symboltracker.go: forward symbolName
  • Update call site in nodebuilderimpl.go: pass symbol.Name as symbolName
  • Update declarations/tracker.go: use TS2883 when symbolName provided, fallback to TS2742 otherwise
  • Add test file declarationEmitUnsafeImportSymbolName.ts
  • Build passes
  • Accept baselines
  • Code review and security scan

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add new TS2883 diagnostic with symbol name in error message
- Keep TS2742 unchanged for backward compatibility
- Update SymbolTracker interface to pass symbolName parameter
- Update all implementations (symboltracker.go, nodebuilderimpl.go, tracker.go)
- Add declarationEmitUnsafeImportSymbolName test case
- Accept updated baselines

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
// since declaration files with these kinds of references are liable to fail when published :(
b.ctx.encounteredError = true
b.ctx.tracker.ReportLikelyUnsafeImportRequiredError(oldSpecifier)
b.ctx.tracker.ReportLikelyUnsafeImportRequiredError(oldSpecifier, symbol.Name)
Copy link
Member

Choose a reason for hiding this comment

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

Can't symbol be nil like the original PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants