Skip to content

Fix declaration emit crash on inaccessible heritage types - #64952

Open
Cheng (chengchuu) wants to merge 2 commits into
microsoft:mainfrom
chengchuu:fix/declaration-emit-heritage-crash
Open

Cheng (chengchuu) wants to merge 2 commits into
microsoft:mainfrom
chengchuu:fix/declaration-emit-heritage-crash

Conversation

@chengchuu

@chengchuu Cheng (chengchuu) commented Oct 24, 2026 •

Copy link
Copy Markdown

Summary

Fixes #64666

Prevent declaration emit from crashing when an exported interface extends a labeled interface. Recognize heritage type references as diagnostic contexts and reuse the existing interface extends and class implements diagnostics.

Regression tests cover both clauses and an inaccessible type argument.

Reproduction

The standalone reproduction prints panic: Diagnostic emitted without context and exits 2. The compiler should report diagnostics for the invalid input without crashing.

Validation

I manually ran the following checks from the repository root on macOS ARM64. All passed:

GOWORK=off go -C tsc test -mod=readonly ./internal/testrunner \
  -run 'TestLocal/declarationEmitInaccessibleHeritageType' -count=1
npx hereby test
npx hereby lint
npx hereby check:format

AI assistance: Copilot helped generate the regression tests. I reviewed the changes and will handle any review feedback or revisions myself.

Copilot AI balanced review requested due to automatic review settings October 24, 2026 15:54
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Oct 24, 2026
@typescript-automation typescript-automation Bot added the For Backlog Bug PRs that fix a backlog bug label Oct 24, 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

🔵 Needs a closer look

Class-expression heritage bases are not fully handled and may still produce incorrect diagnostics.

No open issues 🎉

Review effort: Lite

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 Backlog Bug PRs that fix a backlog bug

Projects

Status: Not started

Development

Successfully merging this pull request may close these issues.

panic: Diagnostic emitted without context

2 participants