C#: Extract underlying methods of foreach statements#4628
Merged
tamasvajk merged 8 commits intogithub:mainfrom Feb 12, 2021
Merged
C#: Extract underlying methods of foreach statements#4628tamasvajk merged 8 commits intogithub:mainfrom
tamasvajk merged 8 commits intogithub:mainfrom
Conversation
1796341 to
fe16a62
Compare
fe16a62 to
2bd06c8
Compare
This comment has been minimized.
This comment has been minimized.
cfd8592 to
58447d4
Compare
This comment has been minimized.
This comment has been minimized.
2c7a143 to
6de5691
Compare
This comment has been minimized.
This comment has been minimized.
e543711 to
1a9f76c
Compare
This comment has been minimized.
This comment has been minimized.
d88023a to
ef55ca1
Compare
hvitved
reviewed
Feb 8, 2021
e5f83be to
1bd154e
Compare
1bd154e to
9854b95
Compare
Contributor
Author
hvitved
requested changes
Feb 12, 2021
| } | ||
|
|
||
| private predicate hasChild(Stmt outer, Element child) { | ||
| outer = child.getParent() |
Contributor
There was a problem hiding this comment.
Add
and
(outer instanceof ForStmt or outer = any(ForStmt f).getBody())that way the relation will be much smaller.
hvitved
approved these changes
Feb 12, 2021
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.
C#9 extends the
foreachstatement to allow usingGetEnumeratorextension methods. To extract these calls, this PR improves the extraction and stores all symbols related toforeachstatements, such asGetEnumerator,MoveNext,Disposemethods,Currentproperty, and element type.TODO:
differences jobdifferences jobdifferences jobdifferences jobhttps://jenkins.internal.semmle.com/job/Changes/job/CSharp-Differences/852/