Conversation
hvitved
force-pushed
the
type-inference-filter-pseudo
branch
from
September 29, 2026 10:07
c2ae6ee to
e0cd79a
Compare
getTypeMentionRoot
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The behavioral change lacks regression coverage, and its documentation is now inaccurate.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Filters pseudo types from root type mentions during shared type inference.
Changes:
- Excludes
PseudoTyperoots. - Limits instantiation candidates to transitive constraints.
| File | Description |
|---|---|
shared/typeinference/codeql/typeinference/internal/TypeInference.qll |
Refines root-type and constraint matching. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+371
to
+373
| private Type getTypeMentionRoot(TypeMention tm) { | ||
| result = tm.getTypeAt(TypePath::nil()) and | ||
| not result instanceof PseudoType |
| private Type getTypeMentionRoot(TypeMention tm) { result = tm.getTypeAt(TypePath::nil()) } | ||
| private Type getTypeMentionRoot(TypeMention tm) { | ||
| result = tm.getTypeAt(TypePath::nil()) and | ||
| not result instanceof PseudoType |
hvitved
commented
Sep 29, 2026
| typeConstraint(type, constraint) and typeCondition(type, abs, condition) | ||
| ) | ||
| ) and | ||
| conditionSatisfiesConstraint(_, _, constraint, true) |
Contributor
Author
There was a problem hiding this comment.
An unrelated small piece of manual magic; I suspect this is what causes the marginal Rust speedup.
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 fixes an issue uncovered by unified DCA nightly for the project
soto-project/sotowhere we mistakenly matchedTypeMentions that cannot resolve (in that case they are interpreted as "resolving" toUnknownType).DCA cannot confirm that
soto-project/sotonow works because it already fails to analyze on the baseline, but I have verified that it works locally. It does show a significant speedup onsignalapp/Signal-iOSthough.DCA for rust also shows a speedup.