Port TypeScript #63026: Fix crash from circularly-reentrant getEffectsSignature#2754
Closed
Port TypeScript #63026: Fix crash from circularly-reentrant getEffectsSignature#2754
Conversation
…ectsSignature Add PropagatesThisKeyword container flag and seenThisKeyword save/restore logic in IsControlFlowContainer branch to prevent infinite recursion when typeof queries in function-like type nodes trigger getEffectsSignature. Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix crash caused by circularly-reentrant getEffectsSignature
Port TypeScript #63026: Fix crash from circularly-reentrant getEffectsSignature
Feb 11, 2026
Member
|
Nothing seems to change, confusingly |
Member
|
I think this needs #2748 to make sense, or rather, this may be a noop after. |
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#63026
Function-like type-level nodes (call signatures, function types, etc.) need their own detached flow node via
IsControlFlowContainerto preventtypeofqueries within them from being narrowed by the containing container's flow graph. Without this, code like the following triggers infinite recursion throughgetEffectsSignature:The Go binder already had
IsControlFlowContaineron these nodes (unlike the TS side which had temporarily lost it), but was missing theseenThisKeywordsave/restore/propagation logic that the TS fix introduced.Changes
ContainerFlagsPropagatesThisKeywordflag (1 << 9) — marks containers that should propagateseenThisKeywordupward (arrow functions, method/call/construct signatures, function/constructor types)seenThisKeywordlifecycle inIsControlFlowContainerbranch — save, reset beforebindChildren, setContainsThisafter, and conditionally propagate viaPropagatesThisKeywordNodeFlagsContainsThisalongside reachability flags during incremental reset, matching TS behaviorGetContainerFlagsto applyPropagatesThisKeywordtoMethodSignature,CallSignature,FunctionType,ConstructSignature,ConstructorType, andArrowFunction💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.