@@ -378,7 +378,17 @@ class ArrayInit extends Expr, @arrayinit {
378
378
override string getAPrimaryQlClass ( ) { result = "ArrayInit" }
379
379
}
380
380
381
- /** A common super-class that represents all varieties of assignments. */
381
+ /**
382
+ * A common super-class that represents many varieties of assignments.
383
+ *
384
+ * This does not cover unary assignments such as `i++`, and initialization of
385
+ * local variables at their declaration such as `int i = 0;`.
386
+ *
387
+ * To cover more cases of variable updates, see the classes `VariableAssign`,
388
+ * `VariableUpdate` and `VarWrite`. But consider that they don't cover array
389
+ * element assignments since there the assignment destination is not directly
390
+ * the array variable but instead an `ArrayAccess`.
391
+ */
382
392
class Assignment extends Expr , @assignment {
383
393
/** Gets the destination (left-hand side) of the assignment. */
384
394
Expr getDest ( ) { result .isNthChildOf ( this , 0 ) }
@@ -1781,6 +1791,9 @@ class VariableUpdate extends Expr {
1781
1791
1782
1792
/**
1783
1793
* An assignment to a variable or an initialization of the variable.
1794
+ *
1795
+ * This does not cover compound assignments such as `i += 1`, or unary
1796
+ * assignments such as `i++`; use the class `VariableUpdate` for that.
1784
1797
*/
1785
1798
class VariableAssign extends VariableUpdate {
1786
1799
VariableAssign ( ) {
@@ -1979,6 +1992,9 @@ class ExtensionReceiverAccess extends VarAccess {
1979
1992
1980
1993
/**
1981
1994
* A write access to a variable, which occurs as the destination of an assignment.
1995
+ *
1996
+ * This does not cover the initialization of local variables at their declaration,
1997
+ * use the class `VariableUpdate` if you want to cover that as well.
1982
1998
*/
1983
1999
class VarWrite extends VarAccess {
1984
2000
VarWrite ( ) { this .isVarWrite ( ) }
0 commit comments