Skip to content

Commit 2229409

Browse files
authored
Merge pull request #1088 from hvitved/csharp/no-qname-for-local-scope-vars
C#: No qualified names for local scope variables
2 parents 01aa4ec + 6f44384 commit 2229409

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

csharp/ql/src/semmle/code/cil/Variable.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ class Variable extends DotNet::Variable, Declaration, DataFlowNode, @cil_variabl
2828
}
2929

3030
/** A stack variable. Either a local variable (`LocalVariable`) or a parameter (`Parameter`). */
31-
class StackVariable extends Variable, @cil_stack_variable { }
31+
class StackVariable extends Variable, @cil_stack_variable {
32+
override predicate hasQualifiedName(string qualifier, string name) { none() }
33+
}
3234

3335
/**
3436
* A local variable.

csharp/ql/src/semmle/code/csharp/Variable.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class LocalScopeVariable extends Variable, @local_scope_variable {
111111
* Holds if this local variable or parameter is a `ref`.
112112
*/
113113
predicate isRef() { none() }
114+
115+
override predicate hasQualifiedName(string qualifier, string name) { none() }
114116
}
115117

116118
/**

0 commit comments

Comments
 (0)