QL: add restrictive transitive closure query#8411
Open
erik-krogh wants to merge 4 commits intogithub:mainfrom
Open
QL: add restrictive transitive closure query#8411erik-krogh wants to merge 4 commits intogithub:mainfrom
erik-krogh wants to merge 4 commits intogithub:mainfrom
Conversation
tausbn
requested changes
Jul 14, 2022
Contributor
tausbn
left a comment
There was a problem hiding this comment.
A few comments, otherwise this looks good to me.
Out of interest, is there a "canonical" fix for the case where you don't want the type to be restricted?
Comment on lines
46
to
51
| not exists(MemberCall memberCall | memberCall.getBase() = c | | ||
| not exists(ClassPredicate pred | | ||
| pred = superClass*(base).getClassPredicate(memberCall.getMemberName()) and | ||
| memberCall.getNumberOfArguments() = pred.getArity() | ||
| ) | ||
| ) |
Contributor
There was a problem hiding this comment.
not exists ... not ... Is this just a forall?
Contributor
Author
The fix I went for was to replace: |
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.


Identifies the mistake fixed in this PR: #8380
Basically, a transitive closure might restrict the type when you do zero steps through it, which might not be intentional.
I think the results found by the query are benign (except for the one already fixed, and the one in the experimental query).