Skip to content
This repository was archived by the owner on Sep 1, 2026. It is now read-only.

Port TS PR 61668 - Fix type variable leaks and cache inconsistencies - #1795

Merged
Jake Bailey (jakebailey) merged 10 commits into
mainfrom
jabaile/port-61668
Oct 9, 2025
Merged

Jake Bailey (jakebailey) merged 10 commits into
mainfrom
jabaile/port-61668

Conversation

@jakebailey

Copy link
Copy Markdown
Member

Ports microsoft/TypeScript#61668.

I am not 100% sure this is correct. Might need Anders Hejlsberg (@ahejlsberg) to attempt it.

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.

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 SingleSignatureType struct 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

Comment thread internal/checker/checker.go Resolved

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with the suggested changes.

Comment thread internal/checker/checker.go Resolved
Comment thread internal/checker/checker.go Resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

⌂ Proxy