13
13
14
14
import csharp
15
15
private import semmle.code.csharp.frameworks.System
16
- private import semmle.code.dotnet.DotNet as DotNet
17
16
18
17
/** An element that should be in the generated code. */
19
18
abstract class GeneratedElement extends Element { }
@@ -22,8 +21,8 @@ abstract class GeneratedElement extends Element { }
22
21
abstract class GeneratedMember extends Member , GeneratedElement { }
23
22
24
23
/** Class representing all `struct`s, such as user defined ones and built-in ones, like `int`. */
25
- private class StructEx extends Type {
26
- StructEx ( ) {
24
+ private class StructExt extends Type {
25
+ StructExt ( ) {
27
26
this instanceof Struct or
28
27
this instanceof SimpleType or
29
28
this instanceof VoidType or
@@ -39,7 +38,7 @@ abstract private class GeneratedType extends Type, GeneratedElement {
39
38
or
40
39
this instanceof Class
41
40
or
42
- this instanceof StructEx
41
+ this instanceof StructExt
43
42
or
44
43
this instanceof Enum
45
44
or
@@ -88,7 +87,7 @@ abstract private class GeneratedType extends Type, GeneratedElement {
88
87
private string stubKeyword ( ) {
89
88
this instanceof Interface and result = "interface"
90
89
or
91
- this instanceof StructEx and result = "struct"
90
+ this instanceof StructExt and result = "struct"
92
91
or
93
92
this instanceof Class and result = "class"
94
93
or
@@ -333,7 +332,7 @@ private class GeneratedNamespace extends Namespace, GeneratedElement {
333
332
}
334
333
335
334
private predicate isInAssembly ( Assembly assembly ) {
336
- any ( GeneratedType gt | gt .( DotNet :: ValueOrRefType ) .getDeclaringNamespace ( ) = this )
335
+ any ( GeneratedType gt | gt .( ValueOrRefType ) .getDeclaringNamespace ( ) = this )
337
336
.isInAssembly ( assembly )
338
337
or
339
338
this .getChildNamespace ( _) .isInAssembly ( assembly )
@@ -354,7 +353,7 @@ private class GeneratedNamespace extends Namespace, GeneratedElement {
354
353
this .isInAssembly ( assembly ) and
355
354
result =
356
355
concat ( GeneratedType gt |
357
- gt .( DotNet :: ValueOrRefType ) .getDeclaringNamespace ( ) = this and gt .isInAssembly ( assembly )
356
+ gt .( ValueOrRefType ) .getDeclaringNamespace ( ) = this and gt .isInAssembly ( assembly )
358
357
|
359
358
gt .getStub ( assembly ) order by gt .getName ( )
360
359
)
@@ -794,7 +793,7 @@ private string stubConstructor(Constructor c, Assembly assembly) {
794
793
then result = ""
795
794
else
796
795
if
797
- not c .getDeclaringType ( ) instanceof StructEx or
796
+ not c .getDeclaringType ( ) instanceof StructExt or
798
797
c .getNumberOfParameters ( ) > 0
799
798
then
800
799
result =
0 commit comments