File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2032,6 +2032,10 @@ class MustBeCopyable final : public ConstraintFix {
2032
2032
2033
2033
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
2034
2034
2035
+ bool diagnoseForAmbiguity (CommonFixesArray commonFixes) const override {
2036
+ return diagnose (*commonFixes.front ().first );
2037
+ }
2038
+
2035
2039
static MustBeCopyable *create (ConstraintSystem &cs,
2036
2040
Type noncopyableTy,
2037
2041
ConstraintLocator *locator);
Original file line number Diff line number Diff line change @@ -4201,7 +4201,7 @@ ConstraintSystem::matchTypesBindTypeVar(
4201
4201
}
4202
4202
}
4203
4203
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.
4205
4205
if (!typeVar->getImpl().canBindToMoveOnly() && type->isPureMoveOnly()) {
4206
4206
if (shouldAttemptFixes()) {
4207
4207
auto *fix = MustBeCopyable::create(*this, type,
You can’t perform that action at this time.
0 commit comments