Reset member resolution after base type resolution - #1779
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a bug in the TypeScript compiler where circular constraints were causing incorrect type resolution, specifically addressing issue #16861. The fix ensures that member resolution is properly reset after base type resolution to handle cases where type parameter defaults cause circularity errors.
- Resets member resolution flags after base type resolution to prevent stale partial resolution
- Removes outdated suspicious logic from
resolveBaseTypesOfClassthat was commented out - Updates test baselines to reflect corrected type resolution behavior
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/checker/checker.go | Adds member resolution reset logic in getBaseTypes and removes commented-out suspicious code in resolveBaseTypesOfClass |
| testdata/baselines/reference/submodule/compiler/circularConstraintYieldsAppropriateError.* | Updates test baselines showing the fix now properly resolves types instead of falling back to any, and reduces errors from 2 to 1 |
jakebailey
approved these changes
Oct 1, 2025
ahejlsberg
enabled auto-merge
October 1, 2025 14:32
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.
This fixes microsoft/TypeScript#16861 in a slightly different manner than in the old compiler. We already had a failing test which now passes.