mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Prioritize type mismatches over labeling failures for calls
Since labels are considered part of the name, mismatches in labeling should be invalidate overload choices. Let's prefer an overload with correct labels but incorrect types over the one with incorrect labels. This also means that it's possible to restore performance optimizations related to early filtering in diagnostic mode, which is important for deeply nested code i.e. SwiftUI views.
This commit is contained in:
@@ -9221,13 +9221,6 @@ bool ConstraintSystem::simplifyAppliedOverloadsImpl(
|
||||
for (auto *choice : choices.slice(1))
|
||||
choice->setDisabled();
|
||||
}
|
||||
|
||||
// Don't attempt further optimization in "diagnostic mode" because
|
||||
// in such mode we'd like to attempt all of the available overloads
|
||||
// regardless of problems related to missing or extraneous labels
|
||||
// and/or arguments.
|
||||
if (solverState)
|
||||
return false;
|
||||
}
|
||||
|
||||
/// The common result type amongst all function overloads.
|
||||
|
||||
Reference in New Issue
Block a user