Skip to content

Commit a6755f1

Browse files
committed
[CSFix] Diagnose multiple solutions with missing closure param as un-ambiguous
If there are multiple overloads and all of them require closure to have a parameter, let's diagnose that as such instead of ambiguity.
1 parent 7d09b30 commit a6755f1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/Sema/CSFix.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,10 @@ class SpecifyClosureParameterType final : public ConstraintFix {
23082308

23092309
bool diagnose(const Solution &solution, bool asNote = false) const override;
23102310

2311+
bool diagnoseForAmbiguity(CommonFixesArray commonFixes) const override {
2312+
return diagnose(*commonFixes.front().first);
2313+
}
2314+
23112315
static SpecifyClosureParameterType *create(ConstraintSystem &cs,
23122316
ConstraintLocator *locator);
23132317

0 commit comments

Comments
 (0)