ruff/crates/ty_python_semantic
Jack O'Connor a357a68fc9 distinguish references from definitions in infer_nonlocal
The initial implementation of `infer_nonlocal` landed in
https://github.com/astral-sh/ruff/pull/19112 fails to report an error
for this example:

```py
x = 1
def f():
    # This is only a usage of `x`, not a definition. It shouldn't be
    # enough to make the `nonlocal` statement below allowed.
    print(x)
    def g():
        nonlocal x
```

Fix this by continuing to walk enclosing scopes when the place we've
found isn't bound, declared, or `nonlocal`.
2025-07-15 07:55:40 -07:00
..
resources distinguish references from definitions in infer_nonlocal 2025-07-15 07:55:40 -07:00
src distinguish references from definitions in infer_nonlocal 2025-07-15 07:55:40 -07:00
tests Auto-generate environment variable references for ty (#19205) 2025-07-08 10:48:31 -04:00
build.rs
Cargo.toml [ty] Remove countme from salsa-structs (#19257) 2025-07-10 11:45:09 +00:00
mdtest.py
mdtest.py.lock