mirror of
https://github.com/astral-sh/ruff.git
synced 2025-11-20 04:29:47 +00:00
[ty] Avoid duplicate diagnostics during multi-inference of standalone expressions (#21056)
## Summary Resolves https://github.com/astral-sh/ty/issues/1428.
This commit is contained in:
parent
adbf05802a
commit
f17ddd62ad
2 changed files with 20 additions and 1 deletions
|
|
@ -97,7 +97,9 @@ impl<'db, 'ast> InferContext<'db, 'ast> {
|
|||
}
|
||||
|
||||
pub(crate) fn extend(&mut self, other: &TypeCheckDiagnostics) {
|
||||
self.diagnostics.get_mut().extend(other);
|
||||
if !self.is_in_multi_inference() {
|
||||
self.diagnostics.get_mut().extend(other);
|
||||
}
|
||||
}
|
||||
|
||||
pub(super) fn is_lint_enabled(&self, lint: &'static LintMetadata) -> bool {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue