Port TS PR 61668 - Fix type variable leaks and cache inconsistencies#1795
Merged
jakebailey merged 10 commits intomainfrom Oct 9, 2025
Merged
Port TS PR 61668 - Fix type variable leaks and cache inconsistencies#1795jakebailey merged 10 commits intomainfrom
jakebailey merged 10 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR ports TypeScript PR #61668, which fixes type variable leaks and cache inconsistencies in generic type inference. The changes focus on improving how type parameters are handled in signature instantiation to prevent incorrect type variable leakage between different inference contexts.
Key Changes:
- Simplified single signature type handling by removing the separate
SingleSignatureTypestruct and treating these as anonymous types - Enhanced outer return type mapping to prevent circular inferences and type parameter leaks
- Improved type mapper creation for better isolation of type parameters across inference contexts
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
:
| File | Description |
|---|---|
internal/checker/types.go |
Removed SingleSignatureType struct and simplified type handling |
internal/checker/checker.go |
Modified signature instantiation logic and added outer return mapper functionality |
internal/checker/inference.go |
Added createOuterReturnMapper function for better type parameter isolation |
internal/checker/nodebuilderimpl.go |
Updated function call to remove outer type parameters parameter |
internal/checker/jsx.go |
Updated JSX signature creation calls to match new API |
internal/testrunner/compiler_runner.go |
Removed test skip for now-working inference test |
testdata/baselines/reference/submodule/compiler/*.types |
Updated type inference test baselines showing improved behavior |
jakebailey
commented
Oct 7, 2025
This reverts commit dbc501f.
ahejlsberg
approved these changes
Oct 9, 2025
Member
ahejlsberg
left a comment
There was a problem hiding this comment.
Approved with the suggested changes.
ahejlsberg
approved these changes
Oct 9, 2025
GGomez99
pushed a commit
to GGomez99/typescript-go
that referenced
this pull request
Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports microsoft/TypeScript#61668.
I am not 100% sure this is correct. Might need @ahejlsberg to attempt it.