Skip to content

Commit 9f0b073

Browse files
authored
Merge pull request #14589 from hvitved/csharp/fqn-backticks
C#: Use `C'X` fully-qualified-name format instead of `C<,...,>`
2 parents 1f0d9e5 + ae3d98f commit 9f0b073

File tree

345 files changed

+3926
-3745
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+3926
-3745
lines changed

csharp/ql/examples/snippets/catch_exception.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
import csharp
1111

1212
from CatchClause catch
13-
where catch.getCaughtExceptionType().hasQualifiedName("System.IO", "IOException")
13+
where catch.getCaughtExceptionType().hasFullyQualifiedName("System.IO", "IOException")
1414
select catch

csharp/ql/examples/snippets/constructor_call.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
import csharp
1111

1212
from ObjectCreation new
13-
where new.getObjectType().hasQualifiedName("System", "Exception")
13+
where new.getObjectType().hasFullyQualifiedName("System", "Exception")
1414
select new

csharp/ql/examples/snippets/extend_class.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
import csharp
1414

1515
from RefType type
16-
where type.getABaseType+().hasQualifiedName("System.Collections", "IEnumerator")
16+
where type.getABaseType+().hasFullyQualifiedName("System.Collections", "IEnumerator")
1717
select type

csharp/ql/examples/snippets/field_read.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import csharp
1111
from Field f, FieldRead read
1212
where
1313
f.hasName("VirtualAddress") and
14-
f.getDeclaringType().hasQualifiedName("Mono.Cecil.PE", "Section") and
14+
f.getDeclaringType().hasFullyQualifiedName("Mono.Cecil.PE", "Section") and
1515
f = read.getTarget()
1616
select read

csharp/ql/examples/snippets/method_call.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ from MethodCall call, Method method
1212
where
1313
call.getTarget() = method and
1414
method.hasName("MethodName") and
15-
method.getDeclaringType().hasQualifiedName("Company", "Class")
15+
method.getDeclaringType().hasFullyQualifiedName("Company", "Class")
1616
select call

csharp/ql/examples/snippets/null_argument.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ where
1717
add.hasName("Add") and
1818
add.getDeclaringType()
1919
.getUnboundDeclaration()
20-
.hasQualifiedName("System.Collections.Generic", "ICollection<>") and
20+
.hasFullyQualifiedName("System.Collections.Generic", "ICollection`1") and
2121
call.getAnArgument() instanceof NullLiteral
2222
select call

csharp/ql/examples/snippets/override_method.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import csharp
1111
from Method override, Method base
1212
where
1313
base.hasName("ToString") and
14-
base.getDeclaringType().hasQualifiedName("System", "Object") and
14+
base.getDeclaringType().hasFullyQualifiedName("System", "Object") and
1515
base.getAnOverrider() = override
1616
select override

csharp/ql/examples/snippets/throw_exception.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
import csharp
1010

1111
from ThrowStmt throw
12-
where throw.getThrownExceptionType().getBaseClass*().hasQualifiedName("System.IO", "IOException")
12+
where
13+
throw.getThrownExceptionType().getBaseClass*().hasFullyQualifiedName("System.IO", "IOException")
1314
select throw
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
1-
| test.cs:1:14:1:20 | GenA<> | System.Object |
2-
| test.cs:1:14:1:20 | GenA<GenB<GenB<>>> | System.Object |
31
| test.cs:1:14:1:20 | GenA<GenB<GenB<String>>> | System.Object |
4-
| test.cs:2:14:2:20 | GenB<> | System.Object |
5-
| test.cs:2:14:2:20 | GenB<GenB<>> | System.Object |
2+
| test.cs:1:14:1:20 | GenA<GenB<GenB`1>> | System.Object |
3+
| test.cs:1:14:1:20 | GenA`1 | System.Object |
64
| test.cs:2:14:2:20 | GenB<GenB<String>> | System.Object |
5+
| test.cs:2:14:2:20 | GenB<GenB`1> | System.Object |
76
| test.cs:2:14:2:20 | GenB<String> | System.Object |
8-
| test.cs:4:7:4:10 | P<> | System.Object |
9-
| test.cs:4:7:4:10 | P<C<,>> | System.Object |
7+
| test.cs:2:14:2:20 | GenB`1 | System.Object |
108
| test.cs:4:7:4:10 | P<C<Int32,String>> | System.Object |
119
| test.cs:4:7:4:10 | P<C<String,Int32>> | System.Object |
1210
| test.cs:4:7:4:10 | P<C<V,U>> | System.Object |
1311
| test.cs:4:7:4:10 | P<C<W,X>> | System.Object |
1412
| test.cs:4:7:4:10 | P<C<X,W>> | System.Object |
15-
| test.cs:4:7:4:10 | P<D<,>> | System.Object |
13+
| test.cs:4:7:4:10 | P<C`2> | System.Object |
1614
| test.cs:4:7:4:10 | P<D<Int32,String>> | System.Object |
1715
| test.cs:4:7:4:10 | P<D<String,Int32>> | System.Object |
1816
| test.cs:4:7:4:10 | P<D<U,V>> | System.Object |
1917
| test.cs:4:7:4:10 | P<D<V,U>> | System.Object |
2018
| test.cs:4:7:4:10 | P<D<X,W>> | System.Object |
21-
| test.cs:5:7:5:13 | C<,> | P<D<V,U>> |
19+
| test.cs:4:7:4:10 | P<D`2> | System.Object |
20+
| test.cs:4:7:4:10 | P`1 | System.Object |
2221
| test.cs:5:7:5:13 | C<Int32,String> | P<D<System.String,System.Int32>> |
2322
| test.cs:5:7:5:13 | C<String,Int32> | P<D<System.Int32,System.String>> |
2423
| test.cs:5:7:5:13 | C<V,U> | P<D<U,V>> |
2524
| test.cs:5:7:5:13 | C<W,X> | P<D<X,W>> |
26-
| test.cs:5:7:5:13 | C<X,W> | P<D<,>> |
27-
| test.cs:6:7:6:13 | D<,> | P<C<W,X>> |
25+
| test.cs:5:7:5:13 | C<X,W> | P<D`2> |
26+
| test.cs:5:7:5:13 | C`2 | P<D<V,U>> |
2827
| test.cs:6:7:6:13 | D<Int32,String> | P<C<System.Int32,System.String>> |
2928
| test.cs:6:7:6:13 | D<String,Int32> | P<C<System.String,System.Int32>> |
30-
| test.cs:6:7:6:13 | D<U,V> | P<C<,>> |
29+
| test.cs:6:7:6:13 | D<U,V> | P<C`2> |
3130
| test.cs:6:7:6:13 | D<V,U> | P<C<V,U>> |
3231
| test.cs:6:7:6:13 | D<X,W> | P<C<X,W>> |
33-
| test.cs:8:7:8:10 | A<> | System.Object |
32+
| test.cs:6:7:6:13 | D`2 | P<C<W,X>> |
3433
| test.cs:8:7:8:10 | A<String> | System.Object |
34+
| test.cs:8:7:8:10 | A`1 | System.Object |
3535
| test.cs:13:14:13:18 | Class | System.Object |

csharp/ql/integration-tests/all-platforms/diag_recursive_generics/Types.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ import csharp
22

33
from Class c
44
where c.fromSource()
5-
select c, c.getBaseClass().getQualifiedName()
5+
select c, c.getBaseClass().getFullyQualifiedName()

0 commit comments

Comments
 (0)