Skip to content

Commit 0b43203

Browse files
authored
Merge pull request #20401 from michaelnebel/csharp/deprecatecapturedforeachvariable
C#: Deprecate `cs/captured-foreach-variable`.
2 parents 0b5745c + 186e42b commit 0b43203

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

csharp/ql/src/Language Abuse/ForeachCapture.ql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/**
2+
* @deprecated This query is no longer relevant as the semantics of capturing a 'foreach' variable
3+
* and using it outside the loop has been stable since C# version 5.
24
* @name Capturing a foreach variable
35
* @description Code that captures a 'foreach' variable and uses it outside the loop behaves differently in C# version 4 and C# version 5
46
* @kind problem
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: deprecated
3+
---
4+
* The query `cs/captured-foreach-variable` has been deprecated as the semantics of capturing a 'foreach' variable and using it outside the loop has been stable since C# version 5.

0 commit comments

Comments
 (0)