Skip to content

Commit 6d973d0

Browse files
authored
Merge pull request #4857 from hvitved/csharp/expr-has-value
C#: Move `Expr::hasValue()` to `DotNet::Expr`
2 parents 2bb9636 + 8d6c69b commit 6d973d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

csharp/ql/src/semmle/code/csharp/exprs/Expr.qll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ class Expr extends DotNet::Expr, ControlFlowElement, @expr {
5151
/** Gets the value of this expression, if any */
5252
override string getValue() { expr_value(this, result) }
5353

54-
/** Holds if this expression has a value. */
55-
predicate hasValue() { exists(getValue()) }
56-
5754
/** Gets the enclosing statement of this expression, if any. */
5855
final Stmt getEnclosingStmt() { enclosingStmt(this, result) }
5956

csharp/ql/src/semmle/code/dotnet/Expr.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ class Expr extends Element, @dotnet_expr {
1717
/** Gets the constant value of this expression, if any. */
1818
string getValue() { none() }
1919

20+
/** Holds if this expression has a value. */
21+
final predicate hasValue() { exists(this.getValue()) }
22+
2023
/**
2124
* Gets the parent of this expression. This is for example the element
2225
* that uses the result of this expression.

0 commit comments

Comments
 (0)