mirror of
https://github.com/github/codeql.git
synced 2026-06-22 21:27:04 +02:00
Extend C# control flow elements with type mentions
This commit is contained in:
committed by
GitHub
parent
d7ec468e2e
commit
f3c85c0ff7
@@ -6,6 +6,7 @@ import Generics
|
||||
import Location
|
||||
import Namespace
|
||||
import Property
|
||||
import semmle.code.csharp.controlflow.ControlFlowElement
|
||||
private import Conversion
|
||||
private import semmle.code.csharp.metrics.Coupling
|
||||
private import TypeRef
|
||||
@@ -1286,7 +1287,7 @@ class TupleType extends ValueType, @tuple_type {
|
||||
* A type mention, that is, any mention of a type in a source code file.
|
||||
* For example, `int` is mentioned in `int M() { return 1; }`.
|
||||
*/
|
||||
class TypeMention extends @type_mention {
|
||||
class TypeMention extends ControlFlowElement, @type_mention {
|
||||
Type type;
|
||||
@type_mention_parent parent;
|
||||
|
||||
@@ -1319,13 +1320,13 @@ class TypeMention extends @type_mention {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
TypeMention getParent() { result = parent }
|
||||
override TypeMention getParent() { result = parent }
|
||||
|
||||
/** Gets a textual representation of this type mention. */
|
||||
string toString() { result = type.toString() }
|
||||
override string toString() { result = type.toString() }
|
||||
|
||||
/** Gets the location of this type mention. */
|
||||
Location getLocation() { type_mention_location(this, result) }
|
||||
override Location getALocation() { type_mention_location(this, result) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -219,7 +219,7 @@ overlayChangedFiles(
|
||||
/** ELEMENTS **/
|
||||
|
||||
@element = @declaration | @stmt | @expr | @modifier | @attribute | @namespace_declaration
|
||||
| @using_directive | @type_parameter_constraints | @externalDataElement
|
||||
| @using_directive | @type_parameter_constraints | @type_mention | @externalDataElement
|
||||
| @xmllocatable | @asp_element | @namespace | @preprocessor_directive;
|
||||
|
||||
@declaration = @callable | @generic | @assignable | @namespace;
|
||||
|
||||
Reference in New Issue
Block a user