File tree Expand file tree Collapse file tree
csharp/ql/test/library-tests/csharp11 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ public class MyTestClass
4+ {
5+ public string M1 ( int x )
6+ {
7+ // Use an expression that spans across multiple lines in a string interpolation.
8+ return $ "This is my int { x switch
9+ {
10+ 42 => "forty two" ,
11+ _ => "something else"
12+ } } ." ;
13+ }
14+ }
Original file line number Diff line number Diff line change 1+ | Strings.cs:8:16:12:12 | $"..." | Strings.cs:8:18:8:32 | "This is my int " |
2+ | Strings.cs:8:16:12:12 | $"..." | Strings.cs:8:34:12:9 | ... switch { ... } |
3+ | Strings.cs:8:16:12:12 | $"..." | Strings.cs:12:11:12:11 | "." |
Original file line number Diff line number Diff line change 1+ import csharp
2+
3+ query predicate interpolatedstrings ( InterpolatedStringExpr se , Expr e ) {
4+ se .getFile ( ) .getStem ( ) = "Strings" and
5+ ( e = se .getAText ( ) or e = se .getAnInsert ( ) )
6+ }
You can’t perform that action at this time.
0 commit comments