sdk
sdk copied to clipboard
Wrong implementation of yield/yield* in dartdevk
dartdevk doesn't implement yield/yield* behavior described in https://github.com/dart-lang/language/blob/master/accepted/future-releases/async-star-behavior/feature-specification.md
There are several issues.
- If execution is paused on
yield/yield*and stream is cancelled, thenyield*should act like areturn;statement. But it isn't so and it causes failure of the following co19 tests
co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A03_t01 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A03_t01 co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t07 co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t08 co19/Language/Statements/Yield_and_Yield_Each/Yield_Each/execution_async_A03_t09
- In an asynchronous function, an
await for (var event in stream) ... loop first listens on the iterated stream, then for each data event, it executes the body. If the body performs any asynchronous operation (that is, it does not complete synchronously because it executes anyawait,wait fororyield*operation, or it blocks at ayield), then the stream subscription must be paused. It is resumed again when the body completes normally. But it isn't so and it causes failure of
co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A05_t02
- If execution is paused then execution should be blocked at
yield. See failures of
co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t01 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t02 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t03 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t04 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t05 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t06 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t07 co19/Language/Statements/Yield_and_Yield_Each/Yield/execution_async_A01_t08
See full log at https://dart-ci.firebaseapp.com/cl/253664/1