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:
421421# 17| 0: [IntLiteral] 7
422422# 17| 1: [IntLiteral] 8
423423# 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 1111| arguments.cs:70:36:70:36 | 0 | x |
1212| arguments.cs:78:18:78:21 | access to parameter args | args |
1313| 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 7979| lambdas.cs:17:12:17:12 | 7 | 0 |
8080| lambdas.cs:17:15:17:15 | 8 | 0 |
8181| 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 77| lambdas.cs:17:9:17:19 | delegate call | lambdas.cs:15:32:15:32 | x | lambdas.cs:17:12:17:12 | 7 |
88| lambdas.cs:17:9:17:19 | delegate call | lambdas.cs:15:32:15:32 | x | lambdas.cs:17:15:17:15 | 8 |
99| 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()
1616 l3 ( ) ;
1717 l3 ( 7 , 8 , 9 ) ;
1818 }
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+ }
1927}
28+
You can’t perform that action at this time.
0 commit comments