C#: Rename ForeachStmt to ForEachStmt. - #22492
Open
aschackmull wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The renamed primary QL class invalidates six unchanged PrintAst expected-output files.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review tier: Balanced
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
csharp/ql/lib/semmle/code/csharp/Stmt.qll — Changing the primary QL class string makes every PrintAst test containing a foreach node emit… |
What changed in this PR
Renames the C# QL ForeachStmt API to ForEachStmt while retaining deprecated compatibility aliases.
Changes:
- Renames the core and LINQ helper classes.
- Migrates library queries and tests to the new names.
- Updates control-flow, data-flow, and SSA references.
| File | Description |
|---|---|
csharp/ql/test/library-tests/statements/Foreach3.ql |
Updates statement test type. |
csharp/ql/test/library-tests/statements/Foreach1.ql |
Updates statement test type. |
csharp/ql/test/library-tests/csharp9/foreach.ql |
Updates C# 9 foreach tests. |
csharp/ql/test/library-tests/csharp7/ForEach.ql |
Updates C# 7 foreach tests. |
csharp/ql/src/Linq/MissedWhereOpportunity.ql |
Migrates LINQ helper type. |
csharp/ql/src/Linq/MissedSelectOpportunity.ql |
Migrates LINQ helper type. |
csharp/ql/src/Linq/MissedOfTypeOpportunity.ql |
Migrates LINQ helper type. |
csharp/ql/src/Linq/MissedCastOpportunity.ql |
Migrates LINQ helper type. |
csharp/ql/src/Linq/MissedAllOpportunity.ql |
Migrates LINQ helper type. |
csharp/ql/src/Linq/BadMultipleIteration.ql |
Updates consuming-access detection. |
csharp/ql/src/Likely Bugs/Statements/UseBraces.ql |
Updates loop-body handling. |
csharp/ql/src/Likely Bugs/Collections/WriteOnlyContainer.ql |
Updates foreach-variable handling. |
csharp/ql/src/Language Abuse/ForeachCapture.ql |
Renames foreach capture helpers. |
csharp/ql/src/Dead Code/DeadStoreOfLocal.ql |
Updates foreach declarations. |
csharp/ql/src/API Abuse/NoDisposeCallOnLocalIDisposable.ql |
Updates foreach disposal handling. |
csharp/ql/lib/semmle/code/csharp/Stmt.qll |
Renames the public class and adds an alias. |
csharp/ql/lib/semmle/code/csharp/exprs/Expr.qll |
Updates tuple-child traversal. |
csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll |
Updates nullness modeling. |
csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll |
Updates data-flow modeling. |
csharp/ql/lib/semmle/code/csharp/controlflow/internal/ControlFlowGraph.qll |
Updates CFG adapter types. |
csharp/ql/lib/Linq/Helpers.qll |
Renames LINQ classes and adds aliases. |
csharp/ql/consistency-queries/SsaConsistency.ql |
Updates SSA consistency checks. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.