@@ -113,7 +113,7 @@ class Expr extends ExprParent, @expr {
113113 if this instanceof CastingExpr or this instanceof NotNullExpr
114114 then
115115 result = this .( CastingExpr ) .getExpr ( ) .getUnderlyingExpr ( ) or
116- result = this .( NotNullExpr ) .getExpr ( ) .getUnderlyingExpr ( )
116+ result = this .( NotNullExpr ) .getOperand ( ) .getUnderlyingExpr ( )
117117 else result = this
118118 }
119119}
@@ -144,13 +144,13 @@ class CompileTimeConstantExpr extends Expr {
144144 this .( CastingExpr ) .getExpr ( ) .isCompileTimeConstant ( )
145145 or
146146 // The unary operators `+`, `-`, `~`, and `!` (but not `++` or `--`).
147- this .( PlusExpr ) .getExpr ( ) .isCompileTimeConstant ( )
147+ this .( PlusExpr ) .getOperand ( ) .isCompileTimeConstant ( )
148148 or
149- this .( MinusExpr ) .getExpr ( ) .isCompileTimeConstant ( )
149+ this .( MinusExpr ) .getOperand ( ) .isCompileTimeConstant ( )
150150 or
151- this .( BitNotExpr ) .getExpr ( ) .isCompileTimeConstant ( )
151+ this .( BitNotExpr ) .getOperand ( ) .isCompileTimeConstant ( )
152152 or
153- this .( LogNotExpr ) .getExpr ( ) .isCompileTimeConstant ( )
153+ this .( LogNotExpr ) .getOperand ( ) .isCompileTimeConstant ( )
154154 or
155155 // The multiplicative operators `*`, `/`, and `%`,
156156 // the additive operators `+` and `-`,
@@ -943,7 +943,7 @@ class LogicExpr extends Expr {
943943 /** Gets an operand of this logical expression. */
944944 Expr getAnOperand ( ) {
945945 this .( BinaryExpr ) .getAnOperand ( ) = result or
946- this .( UnaryExpr ) .getExpr ( ) = result
946+ this .( UnaryExpr ) .getOperand ( ) = result
947947 }
948948}
949949
@@ -1039,8 +1039,15 @@ class ReferenceEqualityTest extends EqualityTest {
10391039
10401040/** A common super-class that represents unary operator expressions. */
10411041class UnaryExpr extends Expr , @unaryexpr {
1042+ /**
1043+ * DEPRECATED: Use getOperand() instead.
1044+ *
1045+ * Gets the operand expression.
1046+ */
1047+ deprecated Expr getExpr ( ) { result .getParent ( ) = this }
1048+
10421049 /** Gets the operand expression. */
1043- Expr getExpr ( ) { result .getParent ( ) = this }
1050+ Expr getOperand ( ) { result .getParent ( ) = this }
10441051}
10451052
10461053/**
@@ -1773,14 +1780,14 @@ class VariableUpdate extends Expr {
17731780 VariableUpdate ( ) {
17741781 this .( Assignment ) .getDest ( ) instanceof VarAccess or
17751782 this instanceof LocalVariableDeclExpr or
1776- this .( UnaryAssignExpr ) .getExpr ( ) instanceof VarAccess
1783+ this .( UnaryAssignExpr ) .getOperand ( ) instanceof VarAccess
17771784 }
17781785
17791786 /** Gets the destination of this variable update. */
17801787 Variable getDestVar ( ) {
17811788 result .getAnAccess ( ) = this .( Assignment ) .getDest ( ) or
17821789 result = this .( LocalVariableDeclExpr ) .getVariable ( ) or
1783- result .getAnAccess ( ) = this .( UnaryAssignExpr ) .getExpr ( )
1790+ result .getAnAccess ( ) = this .( UnaryAssignExpr ) .getOperand ( )
17841791 }
17851792}
17861793
@@ -1970,7 +1977,7 @@ class VarAccess extends Expr, @varaccess {
19701977 */
19711978 predicate isVarWrite ( ) {
19721979 exists ( Assignment a | a .getDest ( ) = this ) or
1973- exists ( UnaryAssignExpr e | e .getExpr ( ) = this )
1980+ exists ( UnaryAssignExpr e | e .getOperand ( ) = this )
19741981 }
19751982
19761983 /**
0 commit comments