My question is not a duplicate of the possible duplicate, because that question asks: What to do when users try to edit their question to ask another one. I'm asking: what to do when users try to edit code in their question such that it removes the problem from the code example.
I have observed quite a few times a user(usually the newer ones) will ask a question, with a code example to illustrate their problem.
Another user will then post a answer that address the problem(s) in the asker's question. The asker will then edit the code in their question to fix the mistakes/bugs/problems in it, based upon what the answerer pointed out in their answer.
It could be reasonably inferred that the user in question does not fully understand how the SO site works. What is the preferred way to handle users doing such behavior, and inform them of the correct behavior? Would it be appropriate to attempt to edit and fix their question.