File tree Expand file tree Collapse file tree 6 files changed +48
-0
lines changed
csharp/ql/test/library-tests/locations Expand file tree Collapse file tree 6 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ public abstract class A < T >
4+ {
5+ public void Apply ( T t ) { }
6+ public abstract object ToObject ( T t ) ;
7+ }
8+
9+ public class A2 : A < string >
10+ {
11+ public override object ToObject ( string t ) => t ;
12+
13+ public void M ( )
14+ {
15+ A2 other = new ( ) ;
16+ other . Apply ( "" ) ;
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ public class B : A < int >
4+ {
5+ public override object ToObject ( int t ) => t ;
6+ }
Original file line number Diff line number Diff line change 1+ using System ;
2+
3+ class C
4+ {
5+ public void M ( )
6+ {
7+ B b = new B ( ) ;
8+ b . Apply ( 0 ) ;
9+ A2 a2 = new A2 ( ) ;
10+ a2 . Apply ( "" ) ;
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ | A.cs:3:23:3:26 | A`1 | A.cs:5:17:5:21 | Apply | A.cs:5:17:5:21 | A.cs:5:17:5:21 |
2+ | A.cs:3:23:3:26 | A`1 | A.cs:6:28:6:35 | ToObject | A.cs:6:28:6:35 | A.cs:6:28:6:35 |
3+ | A.cs:9:14:9:15 | A2 | A.cs:11:28:11:35 | ToObject | A.cs:11:28:11:35 | A.cs:11:28:11:35 |
4+ | A.cs:9:14:9:15 | A2 | A.cs:13:17:13:17 | M | A.cs:13:17:13:17 | A.cs:13:17:13:17 |
5+ | B.cs:3:14:3:14 | B | B.cs:5:28:5:35 | ToObject | B.cs:5:28:5:35 | B.cs:5:28:5:35 |
6+ | C.cs:3:7:3:7 | C | C.cs:5:17:5:17 | M | C.cs:5:17:5:17 | C.cs:5:17:5:17 |
Original file line number Diff line number Diff line change 1+ import csharp
2+
3+ from Type t , Method m , SourceLocation l
4+ where t = m .getDeclaringType ( ) and l = m .getLocation ( ) and not l instanceof EmptyLocation
5+ select t , m , l
Original file line number Diff line number Diff line change 1+ semmle-extractor-options: --standalone
You can’t perform that action at this time.
0 commit comments