File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed
csharp/ql/test/library-tests/parameters Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Collections . Generic ;
3+
4+ public class LambdaParameterModifiers
5+ {
6+ delegate void MyRef ( ref int i1 ) ;
7+ delegate void MyOut ( out int i2 ) ;
8+ delegate void MyIn ( in int i3 ) ;
9+ delegate void MyRefReadonly ( ref readonly int i4 ) ;
10+
11+ delegate void MyScopedRef ( scoped ref int i5 ) ;
12+
13+ public void M ( )
14+ {
15+ // Explicitly typed lambda parameters with modifiers.
16+ var l1 = ( ref int x1 ) => x1 ;
17+ var l2 = ( out int x2 ) => x2 = 0 ;
18+ var l3 = ( in int x3 ) => x3 ;
19+ var l4 = ( ref readonly int x4 ) => x4 ;
20+ var l5 = ( scoped ref int x5 ) => x5 ;
21+ var l6 = ( params IEnumerable < int > x6 ) => x6 ;
22+
23+ // Implicitly typed lambda parameters with modifiers.
24+ MyRef l7 = ( ref i1 ) => { } ;
25+ MyOut l8 = ( out i2 ) => i2 = 0 ;
26+ MyIn l9 = ( in i3 ) => { } ;
27+ MyRefReadonly l10 = ( ref readonly i4 ) => { } ;
28+ MyScopedRef l11 = ( scoped ref i5 ) => { } ;
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments