ty_python_semantic: report all union diagnostic
This makes one very simple change: we report all call binding errors from each union variant. This does result in duplicate-seeming diagnostics. For example, when two union variants are invalid for the same reason.
This commit is contained in:
committed by
Andrew Gallant
parent
90272ad85a
commit
5ea3a52c8a
@@ -199,11 +199,8 @@ impl<'db> Bindings<'db> {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: We currently only report errors for the first union element. Ideally, we'd report
|
||||
// an error saying that the union type can't be called, followed by subdiagnostics
|
||||
// explaining why.
|
||||
if let Some(first) = self.into_iter().find(|b| b.as_result().is_err()) {
|
||||
first.report_diagnostics(context, node);
|
||||
for binding in self {
|
||||
binding.report_diagnostics(context, node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user