i++ does not yield a variable, but a value.
i++ yields 0.
Then i is incremented to 1.
Then 0 is assigned to i.
Summary: the precedence of operators is maybe not what you expected. Or at least you might've misunderstood where the actual increment of i is happening. It's normal to show people that use of i++ can be split into 2 lines where the line after is doing the incrementation - that's not always correct. It happens before the assignment operator.