Skip to content

Commit ce1b53f

Browse files
committed
Fixed issue with amibguity error with partialApply function.
1 parent ae5611a commit ce1b53f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/swift/Sema/CSFix.h

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

20332033
bool diagnose(const Solution &solution, bool asNote = false) const override;
20342034

2035+
bool diagnoseForAmbiguity(CommonFixesArray commonFixes) const override {
2036+
return diagnose(*commonFixes.front().first);
2037+
}
2038+
20352039
static MustBeCopyable *create(ConstraintSystem &cs,
20362040
Type noncopyableTy,
20372041
ConstraintLocator *locator);

lib/Sema/CSSimplify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4201,7 +4201,7 @@ ConstraintSystem::matchTypesBindTypeVar(
42014201
}
42024202
}
42034203

4204-
// If the type variable cannot bind to a move-only type, fail.
4204+
// If the type variable can't bind to a move-only type, diagnose and fail.
42054205
if (!typeVar->getImpl().canBindToMoveOnly() && type->isPureMoveOnly()) {
42064206
if (shouldAttemptFixes()) {
42074207
auto *fix = MustBeCopyable::create(*this, type,

0 commit comments

Comments
 (0)