micropython/tests/basics/async_for.py.exp
Damien George 606ec9bfb1 py/compile: Fix async for's stack handling of iterator expression.
Prior to this fix, async for assumed the iterator expression was a simple
identifier, and used that identifier as a local to store the intermediate
iterator object.  This is incorrect behaviour.

This commit fixes the issue by keeping the iterator object on the stack as
an anonymous local variable.

Fixes issue #11511.

Signed-off-by: Damien George <damien@micropython.org>
2023-07-13 13:50:50 +10:00

52 lines
359 B
Plaintext

== start ==
init
aiter
init
anext
a
anext
b
anext
c
anext
== finish ==
== start ==
init
aiter
init
anext
d
anext
e
anext
f
anext
AsyncIteratorWrapper-def
== finish ==
init
== start ==
aiter
init
anext
g
anext
h
anext
i
anext
AsyncIteratorWrapper-ghi
== finish ==
init
== start ==
aiter
init
anext
j
anext
k
anext
l
anext
AsyncIteratorWrapper-jkl
== finish ==