mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-02 09:52:18 +00:00
![]() ## Summary This PR adds a debug assertion that asserts that `TypeInference::extend` is only called on results that have the same scope. This is critical because `expressions` uses `ScopedExpressionId` that are local and merging expressions from different scopes would lead to incorrect expression types. We could consider storing `scope` only on `TypeInference` for debug builds. Doing so has the advantage that the `TypeInference` type is smaller of which we'll have many. However, a `ScopeId` is a `u32`... so it shouldn't matter that much and it avoids storing the `scope` both on `TypeInference` and `TypeInferenceBuilder` ## Test Plan `cargo test` |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml |