mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
![]() ## Summary This fix addresses panics related to invalid syntax like the following where a `break` statement is used in a nested definition inside a loop: ```py while True: def b(): x: int break ``` closes #14342 ## Test Plan * New corpus regression tests. * New unit test to make sure we handle nested while loops correctly. This test is passing on `main`, but can easily fail if the `is_inside_loop` state isn't properly saved/restored. |
||
---|---|---|
.. | ||
async_for.md | ||
for.md | ||
iterators.md | ||
while_loop.md |