Skip to content

Fix crash on private constructors in intersection base types - #64165

Open
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/private-intersection-constructor-accessibility
Open

Fix crash on private constructors in intersection base types#64165
Mateusz Burzyński (Andarist) wants to merge 1 commit into
microsoft:mainfrom
Andarist:fix/private-intersection-constructor-accessibility

Conversation

@Andarist

Copy link
Copy Markdown
Contributor

Fixes #62614
Recreates #62622

Copilot AI balanced review requested due to automatic review settings September 4, 2026 07:29
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Sep 4, 2026
@typescript-automation typescript-automation Bot added For Backlog Bug PRs that fix a backlog bug labels Sep 4, 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

The focused checker change safely handles all constructor signatures and includes comprehensive regression baselines.

Pull request overview

Prevents crashes when intersection base types include private constructors by checking each constructor’s declaring class.

Changes:

  • Centralizes constructor accessibility checks across extension and instantiation paths.
  • Adds regression and edge-case coverage with diagnostic, type, and symbol baselines.
File summaries
File Description
tsc/internal/checker/checker.go Safely resolves inaccessible constructors.
tsc/testdata/tests/cases/compiler/extendPrivateConstructorClass2.ts Adds compiler regression cases.
tsc/testdata/baselines/reference/compiler/extendPrivateConstructorClass2.errors.txt Records expected diagnostics.
tsc/testdata/baselines/reference/compiler/extendPrivateConstructorClass2.types Records inferred types.
tsc/testdata/baselines/reference/compiler/extendPrivateConstructorClass2.symbols Records symbol resolution.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

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

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.

Private constructor in mixin causes "Cannot read properties of undefined (reading 'declarations')"

2 participants