Fix crash on private constructors in intersection base types - #64165
Conversation
There was a problem hiding this comment.
🟢 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.
|
TypeScript Bot (@typescript-bot) test it |
|
Jake Bailey (@jakebailey) Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Everything looks good! |
|
Jake Bailey (@jakebailey) Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Jake Bailey (@jakebailey) Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
Fixes #62614
Recreates #62622