Based on the docs while it may return a value it r...
# announcements
r
Based on the docs while it may return a value it reassigns it mutating:
Copy code
The inc() and dec() functions must return a value, which will be assigned to the variable on which the ++ or -- operation was used. They shouldn't mutate the object on which the inc or dec was invoked.

The compiler performs the following steps for resolution of an operator in the postfix form, e.g. a++:

Determines the type of a, let it be T;
Looks up a function inc() with the operator modifier and no parameters, applicable to the receiver of type T;
Checks that the return type of the function is a subtype of T.
The effect of computing the expression is:

Store the initial value of a to a temporary storage a0;
--> Assign the result of a.inc() to a;
Return a0 as a result of the expression.