Skip to content

Commit 47505b3

Browse files
committed
C#: Add array access test for an inline array.
1 parent 0453bb8 commit 47505b3

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| expressions.cs:79:14:79:25 | MainAccesses | expressions.cs:89:13:89:26 | access to array element |
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* @name Test for inline array access
3+
*/
4+
5+
import csharp
6+
7+
from Method m, ArrayAccess e
8+
where
9+
m.hasName("MainAccesses") and
10+
e.getEnclosingCallable() = m and
11+
e.getQualifier().(LocalVariableAccess).getTarget().getName() = "inlinearray" and
12+
e.getIndex(0).(IntLiteral).getValue() = "2"
13+
select m, e

0 commit comments

Comments
 (0)