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:
Dhruv Manilawala 2024-11-04 17:11:57 +05:30 committed by GitHub
parent 012f385f5d
commit e302c2de7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 314 additions and 202 deletions

View file

@ -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>>;