mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
describe how generic parameters implicitly require Copyable
This commit is contained in:
@@ -3832,11 +3832,11 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
|
||||
if (type1->getMetatypeInstanceType()->isPureMoveOnly()) {
|
||||
// tailor error message
|
||||
if (shouldAttemptFixes()) {
|
||||
auto *fix =
|
||||
MustBeCopyable::create(*this, type1,
|
||||
{type2,
|
||||
NoncopyableMatchFailure::CastToExistential},
|
||||
getConstraintLocator(locator));
|
||||
auto *fix = MustBeCopyable::create(*this,
|
||||
type1,
|
||||
NoncopyableMatchFailure::forExistentialCast(
|
||||
type2),
|
||||
getConstraintLocator(locator));
|
||||
if (!recordFix(fix))
|
||||
return getTypeMatchSuccess();
|
||||
}
|
||||
@@ -8495,7 +8495,10 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
|
||||
// If this is a failure to conform to Copyable, tailor the error message.
|
||||
if (protocol->isSpecificProtocol(KnownProtocolKind::Copyable)) {
|
||||
auto *fix =
|
||||
MustBeCopyable::create(*this, type, {}, getConstraintLocator(locator));
|
||||
MustBeCopyable::create(*this,
|
||||
type,
|
||||
NoncopyableMatchFailure::forCopyableConstraint(),
|
||||
getConstraintLocator(locator));
|
||||
if (!recordFix(fix))
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user