ruff/crates/ty_python_semantic/src
Charlie Marsh 285d6410d3
[ty] Avoid double-analyzing tuple in `Final` subscript (#21828)
## Summary

As-is, a single-element tuple gets destructured via:

```rust
let arguments = if let ast::Expr::Tuple(tuple) = slice {
    &*tuple.elts
} else {
    std::slice::from_ref(slice)
};
```

But then, because it's a single element, we call
`infer_annotation_expression_impl`, passing in the tuple, rather than
the first element.

Closes https://github.com/astral-sh/ty/issues/1793.
Closes https://github.com/astral-sh/ty/issues/1768.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 14:27:14 +00:00
..
module_resolver [ty] Make auto-import ignore symbols in modules starting with a `_` 2025-12-04 13:21:26 -05:00
semantic_index [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
types [ty] Avoid double-analyzing tuple in `Final` subscript (#21828) 2025-12-07 14:27:14 +00:00
ast_node_ref.rs [ty] Enable LRU collection for parsed module (#21749) 2025-12-03 12:16:18 +01:00
db.rs [ty] Limit shown import paths to at most 5 unless ty runs with `-v` (#20912) 2025-10-16 13:18:09 +02:00
diagnostic.rs [ty] Refactor `CheckSuppressionContext` to use `DiagnosticGuard` (#21587) 2025-11-25 10:54:42 +00:00
dunder_all.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
lib.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
lint.rs [ty] Add hyperlinks to rule codes in CLI (#21502) 2025-11-18 16:36:59 +01:00
list.rs Update Rust toolchain to 1.89 (#19807) 2025-08-07 18:21:50 +02:00
module_name.rs [ty] Add support for relative import completions 2025-11-21 08:01:02 -05:00
node_key.rs [ty] Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248) 2025-09-05 17:56:06 +01:00
place.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
program.rs [ty] Remove mentions of VS Code from server logs (#21155) 2025-11-03 14:49:58 +00:00
pull_types.rs Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
python_platform.rs Update Rust toolchain to 1.91 (#21179) 2025-11-01 01:50:58 +00:00
rank.rs [ty] Garbage-collect reachability constraints (#19414) 2025-07-21 14:16:27 -04:00
semantic_index.rs [ty] Skip eagerly evaluated scopes for attribute storing (#20856) 2025-11-11 14:45:34 -08:00
semantic_model.rs [ty] Teach `ty` the meaning of desperation (try ancestor `pyproject.toml`s as search-paths if module resolution fails) (#21745) 2025-12-03 15:04:36 -05:00
site_packages.rs [ty] Discover site-packages from the environment that ty is installed in (#21286) 2025-11-06 09:27:49 -05:00
subscript.rs [ty] Use "cannot" consistently over "can not" (#21255) 2025-11-03 10:38:20 -05:00
suppression.rs [ty] Fix crash when hovering an unknown string annotation (#21782) 2025-12-04 09:11:40 +01:00
types.rs [ty] Complete support for `ParamSpec` (#21445) 2025-12-05 22:00:06 +05:30
unpack.rs [ty] Track heap usage of salsa structs (#19790) 2025-08-12 13:28:44 +02:00