You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tvolkert opened this issue
Aug 21, 2019
· 1 comment
Labels
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
This is a bug in the implementation of async* methods.
In Dart 1, the specfication was not precise about what should happen at a yield.
The Dart 2 specification now states that it must deliver the event and then check for pauses (and be ready to handle a cancel while paused), and an await for should receive the event and then pause its subscription if it does any await. Together those should prevent the behavior you see here.
The implementations have not moved to the specified behavior yet, though. That's #34775.
lrhn
added
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
labels
Aug 21, 2019
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)
Consider the following code:
This produces the following output:
Now, if we change the code to insert an async task in the
await for
loop, like so:It instead produces the following output:
For some reason, the introduction of an extra
await
on async work within theawait for
loop caused us to yield an extra value.The text was updated successfully, but these errors were encountered: