Fix narrowing of generic this parameters - #64187
Fix narrowing of generic this parameters#64187Mateusz Burzyński (Andarist) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The focused checker change consistently matches parameter behavior and is covered by comprehensive regression baselines.
Pull request overview
Aligns control-flow narrowing of generic this parameters with ordinary parameters, fixing #64186.
Changes:
- Applies narrowable constraint types to
thisreferences while preserving check modes. - Adds regression tests for direct, aliased, contextual, indexed, and inferential usage.
- Adds diagnostic, type, and symbol baselines.
File summaries
| File | Description |
|---|---|
tsc/internal/checker/checker.go |
Enables consistent narrowing for generic this. |
tsc/testdata/tests/cases/compiler/controlFlowGenericThis.ts |
Tests core narrowing behavior. |
tsc/testdata/tests/cases/compiler/controlFlowGenericThisContextual.ts |
Tests contextual and inferential behavior. |
tsc/testdata/baselines/reference/compiler/controlFlowGenericThis.errors.txt |
Records expected diagnostics. |
tsc/testdata/baselines/reference/compiler/controlFlowGenericThis.types |
Records inferred types. |
tsc/testdata/baselines/reference/compiler/controlFlowGenericThis.symbols |
Records resolved symbols. |
tsc/testdata/baselines/reference/compiler/controlFlowGenericThisContextual.types |
Records contextual inferred types. |
tsc/testdata/baselines/reference/compiler/controlFlowGenericThisContextual.symbols |
Records contextual symbols. |
Review details
- Files reviewed: 8/8 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 they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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 are the results of running the top 400 repos with tsc comparing Everything looks good! |
fixes #64186