Repository navigation
Conversation
hvitved
force-pushed
the
type-inference-share
branch
7 times, most recently
from
November 11, 2026 08:49
1563a10 to
fe5b9ae
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Constraint lookup combines distinct bounds on the same trait, allowing satisfaction and type-parameter extraction to use different bounds and produce incorrect type inference.
1 open issue
What changed in this PR
This PR reduces duplication in the shared type-inference library by consolidating matching for declaration types and type-parameter constraints.
Changes:
- Introduces a unified
ConstraintMatchingmodule and constraint-position abstractions. - Routes base-type matching and contextual inference through the shared constraint matcher.
- Extracts helper predicates for disambiguating constraint satisfaction.
| File | Description |
|---|---|
shared/typeinference/codeql/typeinference/internal/TypeInference.qll |
Unifies constraint representations and matching logic, and extracts disambiguation helpers. |
Review effort: Max
hvitved
force-pushed
the
type-inference-share
branch
from
November 11, 2026 09:46
fe5b9ae to
79fea46
Compare
hvitved
marked this pull request as ready for review
November 11, 2026 12:52
This branch has not been deployed
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 PR reduces code duplication by merging
AccessBaseTypeandAccessConstraintlogic into a singleConstraintMatchingmodule, as originally suggested by @paldepind here. DCA us uneventful for both Rust and Unified, except there appears to be a small performance improvement for Rust.