mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-01 09:22:19 +00:00
![]() ## Summary This fixes several panics related to invalid assignment targets. All of these led to some a crash, previously: ```py (x.y := 1) # only name-expressions are valid targets of named expressions ([x, y] := [1, 2]) # same (x, y): tuple[int, int] = (2, 3) # tuples are not valid targets for annotated assignments (x, y) += 2 # tuples are not valid targets for augmented assignments ``` closes #14321 closes #14322 ## Test Plan I symlinked four files from `crates/ruff_python_parser/resources` into the red knot corpus, as they seemed like ideal test files for this exact scenario. I think eventually, it might be a good idea to simply include *all* invalid-syntax examples from the parser tests into red knots corpus (I believe we're actually not too far from that goal). Or expand the scope of the corpus test to this directory. Then we can get rid of these symlinks again. |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |