Should I flag the asker's answer (as not-an-answer) or should I just downvote their answer?
Each answer should be judged on its own merit, including self-answers. Self answers are allowed,
- including when there are other answers,
- including when the OP accepts another answer,
- including when they accept another answer before posting their own,
- even when (which did not happen in the example case) they then change the accepted answer to their own.
None of that is in itself a reason to downvote, much less flag.
In the particular case linked, it's not even clear that the OP wrote their self-answer with reference to the other. The two were posted within about a minute of each other.
However, both answers do conclude that the problem is addressed by a very small rearrangement of the code of one line. Thus, the problem is reasonably categorized as arising from a syntax error, and as such, neither answer should have been posted. The OP should probably have deleted the question, and the other answerer should have commented and voted to close instead of answering.
The question now has been closed as arising from a typo, so meta came to the rescue there, and it has even been deleted, which seems a bit overkill, but also no big loss.
)
.