Merge pull request #65668 from kavon/noncopyable-metatypes-redo

Noncopyable metatypes redo
This commit is contained in:
Kavon Farvardin
2023-05-04 16:42:06 -07:00
committed by GitHub
6 changed files with 43 additions and 17 deletions

View File

@@ -3827,8 +3827,8 @@ ConstraintSystem::matchExistentialTypes(Type type1, Type type2,
return getTypeMatchAmbiguous();
}
// move-only types cannot match with any existential types.
if (type1->isPureMoveOnly()) {
// move-only types (and their metatypes) cannot match with existential types.
if (type1->getMetatypeInstanceType()->isPureMoveOnly()) {
// tailor error message
if (shouldAttemptFixes()) {
auto *fix = MustBeCopyable::create(*this, type1,