During execution of g, await is hit twice. So, if I understand correctly, there are two “checkpoints” where the state can be changed by another “thread”.
I remember there was a good, lengthy explanation in the release notes (or somewhere else on github) when this was introduced, in moc 0.7.4. But now I don’t find it anymore. The release notes for 0.7.4. are brief. Must have been somewhere else on github but I can’t find it.
When an async* returns you won’t know if a checkpoint triggered or not unless you mange it. I recommend never calling async* unless it returns this(or similar) structure. of course if you ALWAYS await this isn’t the case…but any branches induce a safety issue.