mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:43 +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. |
||
---|---|---|
.. | ||
mdtest | ||
README.md |
Markdown files within the mdtest/
subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs
integration test.
See crates/red_knot_test/README.md
for documentation of this test format.