ruff/crates/red_knot_python_semantic/resources/mdtest/loops
David Peter f6b2cd5588
[red-knot] Semantic index: handle invalid breaks (#14522)
## 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.
2024-11-22 13:13:55 +01:00
..
async_for.md [red-knot] Meta data for Type::Todo (#14500) 2024-11-21 09:59:47 +01:00
for.md [red-knot] Shorten the paths for some mdtest files (#14267) 2024-11-11 11:34:33 +00:00
iterators.md [red-knot] Format mdtest Python snippets more concisely (#13905) 2024-10-24 11:09:31 +00:00
while_loop.md [red-knot] Semantic index: handle invalid breaks (#14522) 2024-11-22 13:13:55 +01:00