Repository navigation
Conversation
hvitved
force-pushed
the
unified/static-name-binding-prevent-self-inheritence
branch
from
November 5, 2026 21:16
685e67e to
839aba2
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The lookup guard leaves valid Swift references such as Node.Leaf.Leaf unbound and causes subclasses to lose inherited type bindings.
1 open issue
What changed in this PR
Updates unified static name binding to address incorrect results from UnqualifiedMemberAccess.getAccessingClass() for nested Swift subclasses.
Changes:
- Add self-inheritance filtering to member lookup.
- Remove binding pragmas from unqualified-access candidate resolution.
- Add a Swift regression fixture and query output for accessing classes.
| File | Description |
|---|---|
unified/ql/test/library-tests/static-name-binding/unqualified-access.swift |
Adds the nested Node.Leaf regression case. |
unified/ql/test/library-tests/static-name-binding/test.ql |
Queries unqualified accesses and their accessing classes. |
unified/ql/test/library-tests/static-name-binding/test.expected |
Records expected accessing-class query results. |
unified/ql/lib/codeql/unified/internal/StaticNameBinding.qll |
Filters self-inheritance and updates candidate resolution. |
Review effort: Max
Comment on lines
+452
to
+455
| not exists(ClassLikeDeclaration self | | ||
| this.isStaticMemberNamespace(self) and | ||
| n.isMember(self) | ||
| ) |
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.

No description provided.