Complete port of TS PR #61668: revert #57403 remnants missing from Go port#2979
Merged
ahejlsberg merged 2 commits intomainfrom Mar 4, 2026
Merged
Complete port of TS PR #61668: revert #57403 remnants missing from Go port#2979ahejlsberg merged 2 commits intomainfrom
ahejlsberg merged 2 commits intomainfrom
Conversation
…nSignature, and inferenceContext from isSignatureApplicable Co-authored-by: ahejlsberg <4226954+ahejlsberg@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Compare differences between TypeScript PR 61668 and typescript-go PR 1795
Complete port of TS PR #61668: revert #57403 remnants missing from Go port
Mar 4, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the Go port of TypeScript PR #61668 by including the missing “revert PR #57403” cleanups in the checker, removing now-obsolete inference and overload-resolution machinery that conflicts with the newer createOuterReturnMapper approach.
Changes:
- Removes the
isTupleOfSelfearly-exit inference heuristic frominferFromTypes. - Removes the “implementation signature” cloning path (
getImplementationSignature/SignatureKeyImplementation) used when resolving calls inside a function’s own body. - Simplifies overload applicability/type inference flow by dropping
instantiateTypes(...)wrapping aroundinferTypeArguments(...), and removing theinferenceContextparameter fromisSignatureApplicable.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/checker/inference.go | Removes isTupleOfSelf and its use in inference candidate handling. |
| internal/checker/checker.go | Removes implementation-signature caching/cloning and simplifies overload applicability and inference plumbing to match upstream revert. |
ahejlsberg
approved these changes
Mar 4, 2026
Member
|
I have manually verified that this adds the missing parts of TS PR #61668. |
jakebailey
approved these changes
Mar 4, 2026
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.
The Go port of TypeScript PR #61668 (PR #1795) only ported the new
createOuterReturnMappermachinery but omitted the revert of TS PR #57403 that the original PR also performed. This leaves the Go checker with dead/conflicting code that was supposed to be removed.Missing changes now ported
Remove
isTupleOfSelf(inference.go): Discarded the early-exit for inferences of the formA → [A[0]]. The newcreateOuterReturnMapperapproach handles circular inference prevention more generally.Remove
getImplementationSignature/SignatureKeyImplementation(checker.go): Eliminated the candidate-cloning path that was triggered when resolving a call from inside the called function's own body. No longer needed with the revised contextual type instantiation strategy.Remove
instantiateTypeswrapping aroundinferTypeArguments(checker.go,chooseOverload): Both the first-pass (nonFixingMapper) and second-pass (mapper) wrappings were TS PR #57403 additions and are now dropped, soinferTypeArgumentsresults are used directly.Remove
inferenceContextparameter fromisSignatureApplicable(checker.go): The parameter was only used to instantiate argument types vianonFixingMapperbefore assignability checks—another TS PR #57403 artifact. Simplified to always use the plain (possibly regularized) argument type.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.