mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-21 02:50:52 +00:00
Cached inference of all definitions in an unpacking (#13979)
## Summary This PR adds a new salsa query and an ingredient to resolve all the variables involved in an unpacking assignment like `(a, b) = (1, 2)` at once. Previously, we'd recursively try to match the correct type for each definition individually which will result in creating duplicate diagnostics. This PR still doesn't solve the duplicate diagnostics issue because that requires a different solution like using salsa accumulator or de-duplicating the diagnostics manually. Related: #13773 ## Test Plan Make sure that all unpack assignment test cases pass, there are no panics in the corpus tests. ## Todo - [x] Look at the performance regression
This commit is contained in:
parent
012f385f5d
commit
e302c2de7c
7 changed files with 314 additions and 202 deletions
|
@ -22,6 +22,7 @@ pub(crate) mod site_packages;
|
|||
mod stdlib;
|
||||
pub(crate) mod symbol;
|
||||
pub mod types;
|
||||
mod unpack;
|
||||
mod util;
|
||||
|
||||
type FxOrderSet<V> = ordermap::set::OrderSet<V, BuildHasherDefault<FxHasher>>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue