File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
csharp/ql/test/library-tests/dataflow/delegates Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,11 @@ class DelegateFlow
44{
55 void M1 ( int i ) { }
66
7- void M2 ( Action < int > a )
7+ static void M2 ( Action < int > a )
88 {
99 a ( 0 ) ;
1010 a = _ => { } ;
11- a ( 0 ) ;
11+ a ( 1 ) ;
1212 }
1313
1414 void M3 ( )
@@ -108,4 +108,20 @@ public void M15()
108108 }
109109
110110 public delegate void MyDelegate ( ) ;
111+
112+ public unsafe void M16 ( delegate * < Action < int > , void > fnptr , Action < int > a )
113+ {
114+ fnptr ( a ) ;
115+ }
116+
117+ public unsafe void M17 ( )
118+ {
119+ M16 ( & M2 , ( i ) => { } ) ; // MISSING: a(0) in M2 is calling this lambda
120+ }
121+
122+ public unsafe void M18 ( )
123+ {
124+ delegate * < Action < int > , void > fnptr = & M2 ;
125+ fnptr ( ( i ) => { } ) ; // MISSING: a(0) in M2 is calling this lambda
126+ }
111127}
You can’t perform that action at this time.
0 commit comments