File tree Expand file tree Collapse file tree 5 files changed +42
-0
lines changed
csharp/ql/test/library-tests/arguments Expand file tree Collapse file tree 5 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -421,3 +421,30 @@ lambdas.cs:
421
421
# 17| 0: [IntLiteral] 7
422
422
# 17| 1: [IntLiteral] 8
423
423
# 17| 2: [IntLiteral] 9
424
+ # 20| 6: [DelegateType] MyDelegate
425
+ #-----| 2: (Parameters)
426
+ # 20| 0: [Parameter] x
427
+ # 20| -1: [TypeMention] int
428
+ # 20| 1: [Parameter] y
429
+ # 20| -1: [TypeMention] int
430
+ # 22| 7: [Method] M2
431
+ # 22| -1: [TypeMention] Void
432
+ # 23| 4: [BlockStmt] {...}
433
+ # 24| 0: [LocalVariableDeclStmt] ... ...;
434
+ # 24| 0: [LocalVariableDeclAndInitExpr] MyDelegate sum = ...
435
+ # 24| -1: [TypeMention] MyDelegate
436
+ # 24| 0: [LocalVariableAccess] access to local variable sum
437
+ # 24| 1: [LambdaExpr] (...) => ...
438
+ #-----| 2: (Parameters)
439
+ # 24| 0: [Parameter] x
440
+ # 24| -1: [TypeMention] int
441
+ # 24| 1: [Parameter] y
442
+ # 24| -1: [TypeMention] int
443
+ # 24| 4: [AddExpr] ... + ...
444
+ # 24| 0: [ParameterAccess] access to parameter x
445
+ # 24| 1: [ParameterAccess] access to parameter y
446
+ # 25| 1: [ExprStmt] ...;
447
+ # 25| 0: [DelegateCall] delegate call
448
+ # 25| -1: [LocalVariableAccess] access to local variable sum
449
+ # 25| 0: [IntLiteral] 4
450
+ # 25| 1: [IntLiteral] 5
Original file line number Diff line number Diff line change 11
11
| arguments.cs:70:36:70:36 | 0 | x |
12
12
| arguments.cs:78:18:78:21 | access to parameter args | args |
13
13
| arguments.cs:78:27:78:27 | 0 | o |
14
+ | lambdas.cs:25:16:25:16 | 4 | y |
15
+ | lambdas.cs:25:22:25:22 | 5 | x |
Original file line number Diff line number Diff line change 79
79
| lambdas.cs:17:12:17:12 | 7 | 0 |
80
80
| lambdas.cs:17:15:17:15 | 8 | 0 |
81
81
| lambdas.cs:17:18:17:18 | 9 | 0 |
82
+ | lambdas.cs:25:16:25:16 | 4 | 0 |
83
+ | lambdas.cs:25:22:25:22 | 5 | 0 |
Original file line number Diff line number Diff line change 7
7
| lambdas.cs:17:9:17:19 | delegate call | lambdas.cs:15:32:15:32 | x | lambdas.cs:17:12:17:12 | 7 |
8
8
| lambdas.cs:17:9:17:19 | delegate call | lambdas.cs:15:32:15:32 | x | lambdas.cs:17:15:17:15 | 8 |
9
9
| lambdas.cs:17:9:17:19 | delegate call | lambdas.cs:15:32:15:32 | x | lambdas.cs:17:18:17:18 | 9 |
10
+ | lambdas.cs:25:9:25:23 | delegate call | lambdas.cs:24:31:24:31 | x | lambdas.cs:25:16:25:16 | 4 |
11
+ | lambdas.cs:25:9:25:23 | delegate call | lambdas.cs:24:38:24:38 | y | lambdas.cs:25:22:25:22 | 5 |
Original file line number Diff line number Diff line change @@ -16,4 +16,13 @@ void M1()
16
16
l3 ( ) ;
17
17
l3 ( 7 , 8 , 9 ) ;
18
18
}
19
+
20
+ delegate int MyDelegate ( int x , int y ) ;
21
+
22
+ void M2 ( )
23
+ {
24
+ MyDelegate sum = ( int x , int y ) => x + y ;
25
+ sum ( y : 4 , x : 5 ) ;
26
+ }
19
27
}
28
+
You can’t perform that action at this time.
0 commit comments