Fix VoidType handling

This commit is contained in:
Tamas Vajk
2021-06-23 11:30:47 +02:00
parent 133d760659
commit d698f0ae27

View File

@@ -13,6 +13,7 @@
import csharp
private import semmle.code.csharp.frameworks.System
private import semmle.code.dotnet.DotNet as DotNet // added to handle VoidType as a ValueOrRefType
/** An element that should be in the generated code. */
abstract class GeneratedElement extends Element { }
@@ -332,7 +333,7 @@ private class GeneratedNamespace extends Namespace, GeneratedElement {
}
private predicate isInAssembly(Assembly assembly) {
any(GeneratedType gt | gt.(ValueOrRefType).getDeclaringNamespace() = this)
any(GeneratedType gt | gt.(DotNet::ValueOrRefType).getDeclaringNamespace() = this)
.isInAssembly(assembly)
or
this.getChildNamespace(_).isInAssembly(assembly)
@@ -353,7 +354,7 @@ private class GeneratedNamespace extends Namespace, GeneratedElement {
this.isInAssembly(assembly) and
result =
concat(GeneratedType gt |
gt.(ValueOrRefType).getDeclaringNamespace() = this and gt.isInAssembly(assembly)
gt.(DotNet::ValueOrRefType).getDeclaringNamespace() = this and gt.isInAssembly(assembly)
|
gt.getStub(assembly) order by gt.getName()
)